init commit
This commit is contained in:
17
store/migration/sqlite/0.22/00__resource_storage_type.sql
Normal file
17
store/migration/sqlite/0.22/00__resource_storage_type.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
ALTER TABLE resource ADD COLUMN storage_type TEXT NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE resource ADD COLUMN reference TEXT NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE resource ADD COLUMN payload TEXT NOT NULL DEFAULT '{}';
|
||||
|
||||
UPDATE resource
|
||||
SET storage_type = 'LOCAL', reference = internal_path
|
||||
WHERE internal_path IS NOT NULL AND internal_path != '';
|
||||
|
||||
UPDATE resource
|
||||
SET storage_type = 'EXTERNAL', reference = external_link
|
||||
WHERE external_link IS NOT NULL AND external_link != '';
|
||||
|
||||
ALTER TABLE resource DROP COLUMN internal_path;
|
||||
|
||||
ALTER TABLE resource DROP COLUMN external_link;
|
||||
3
store/migration/sqlite/0.22/01__memo_tags.sql
Normal file
3
store/migration/sqlite/0.22/01__memo_tags.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE memo ADD COLUMN tags TEXT NOT NULL DEFAULT '[]';
|
||||
|
||||
CREATE INDEX idx_memo_tags ON memo (tags);
|
||||
1
store/migration/sqlite/0.22/02__memo_payload.sql
Normal file
1
store/migration/sqlite/0.22/02__memo_payload.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE memo ADD COLUMN payload TEXT NOT NULL DEFAULT '{}';
|
||||
1
store/migration/sqlite/0.22/03__drop_tag.sql
Normal file
1
store/migration/sqlite/0.22/03__drop_tag.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE tag;
|
||||
Reference in New Issue
Block a user