🎨 基于内容块属性动态建立对应数据库表结构 https://github.com/siyuan-note/siyuan/issues/7521

This commit is contained in:
Liang Ding 2023-03-02 09:27:07 +08:00
parent aa664856cc
commit 7dcef7b84b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 30 additions and 6 deletions

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Package av 是属性视图相关的实现。
// Package av 包含了属性视图Attribute View相关的实现。
package av
import (

View file

@ -47,3 +47,10 @@ func (c *BaseColumn) Name() string {
func (c *BaseColumn) Type() string {
return c.BaseType
}
// ColumnValueResolver 描述了属性视图的列值解析器。
type ColumnValueResolver interface {
// Resolve 用于解析列值。
Resolve() string
}

View file

@ -20,8 +20,3 @@ type ColumnRelation struct {
*BaseColumn
AttributeViewID string `json:"attributeViewId"` // 关联的属性视图 ID
}
type AttributeViewColumnRollup struct {
*BaseColumn
RelationID string `json:"relationId"` // 目标关联列 ID
}

View file

@ -0,0 +1,22 @@
// SiYuan - Build Your Eternal Digital Garden
// Copyright (c) 2020-present, b3log.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package av
type ColumnRollup struct {
*BaseColumn
RelationColumnID string `json:"relationColumnId"` // 目标关联列 ID
}