init commit
This commit is contained in:
11
store/migration/postgres/0.22/00__resource_storage_type.sql
Normal file
11
store/migration/postgres/0.22/00__resource_storage_type.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
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;
|
||||
1
store/migration/postgres/0.22/01__memo_tags.sql
Normal file
1
store/migration/postgres/0.22/01__memo_tags.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE memo ADD COLUMN tags JSONB NOT NULL DEFAULT '[]';
|
||||
1
store/migration/postgres/0.22/02__memo_payload.sql
Normal file
1
store/migration/postgres/0.22/02__memo_payload.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE memo ADD COLUMN payload JSONB NOT NULL DEFAULT '{}';
|
||||
1
store/migration/postgres/0.22/03__drop_tag.sql
Normal file
1
store/migration/postgres/0.22/03__drop_tag.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS tag;
|
||||
Reference in New Issue
Block a user