Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: postgres upgrade script
Steven29a22914cfea
diff --git a/store/db/postgres/migration/prod/0.22/00__resource_storage_type.sql b/store/db/postgres/migration/prod/0.22/00__resource_storage_type.sqlindex 918d44567..00cd9b26a 100644--- a/store/db/postgres/migration/prod/0.22/00__resource_storage_type.sql+++ b/store/db/postgres/migration/prod/0.22/00__resource_storage_type.sql@@ -1,16 +1,11 @@-ALTER TABLE `resource`- ADD COLUMN `storage_type` VARCHAR(256) NOT NULL DEFAULT '',- ADD COLUMN `reference` VARCHAR(256) NOT NULL DEFAULT '',- ADD COLUMN `payload` TEXT NOT NULL;+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 = '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` != '';+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 internal_path;-ALTER TABLE `resource` DROP COLUMN `external_link`;+ALTER TABLE resource DROP COLUMN external_link;