Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用GRDB本地持久性。
GRDB
在Item表中创建具有以下约束的列。
Item
table.column(Item.CodingKeys.text.rawValue, .text).notNull()
现在我想更改它以支持可选值。
table.column(Item.CodingKeys.text.rawValue, .text)
但是为了迁移,我不能改变它的属性。仅add, rename适用于列。
add, rename
在保持向后兼容性的同时,我应该采取什么方法来正确迁移?
ALTER COLUMN中是不可能的SQLite。
ALTER COLUMN
SQLite
仅支持更改操作:
参考: