Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete attributes of related blocks when deleting database blocks #9287

Closed
88250 opened this issue Sep 27, 2023 · 10 comments
Closed

Delete attributes of related blocks when deleting database blocks #9287

88250 opened this issue Sep 27, 2023 · 10 comments
Assignees

Comments

@88250
Copy link
Member

88250 commented Sep 27, 2023

https://ld246.com/article/1695780728736

@88250 88250 self-assigned this Sep 27, 2023
@zxhd863943427
Copy link
Contributor

需要考虑复制视图的引用情况。在视图引用不清零前不要删除。

@88250
Copy link
Member Author

88250 commented Sep 28, 2023

目前复制数据库块是浅克隆(也就是引用),实际上其中的行指向的块的 custom-avs 属性是没有包含多个 av id 的,av id 都是一个。要判断的话只能遍历解析整个 data 下的 .sy 文件,从块的 custom-avs 上判断,感觉这个方法代价太高了,有点得不偿失。

换个思路就是用户手动清理,删除数据库的时候虽然没有关联删除块 avs,打开这个块属性面板后:

image

这里的 表格1 就是删掉的,这里加一个删除按钮,表示从这个库里面移除这一行(当前这个块),这样也算是能够清理了。你觉得呢?

@zxhd863943427
Copy link
Contributor

感觉还是早点为属性视图建表比较好,不过这个方案也行。假如不自动清理的话,那就要考虑被清除了引用的属性视图该怎么重新引用和如何手动清理了,上面提到的只是清理了属性视图内的行而已。

@88250
Copy link
Member Author

88250 commented Oct 5, 2023

重新考虑了下整体设计,这个地方还是不做删除吧,原因和闪卡类似,考虑到多种数据恢复的场景,无法做到强一致性,所以就还是让 custom-avs 属性冗余吧。

#9285 也存在类似的问题,以这边这条讨论为基础继续考虑。

@zxhd863943427
Copy link
Contributor

这个设计我觉得可以,不过还得看看最终的效果怎么样。

另外,是否需要考虑当表内的行清零后删除属性视图?

@88250
Copy link
Member Author

88250 commented Oct 5, 2023

另外,是否需要考虑当表内的行清零后删除属性视图?

不考虑啊,初始的时候就是空的。

@zxhd863943427
Copy link
Contributor

好像也是……那有删除属性视图的设置吗?

@88250
Copy link
Member Author

88250 commented Oct 5, 2023

#9285 (comment) 用户手动删除行。

@zxhd863943427
Copy link
Contributor

我是说数据库本身的哪个json,有删除的机制吗?

@88250
Copy link
Member Author

88250 commented Oct 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants