From 74218e885e0cb06943d0ab0994fd9380e14cf0d0 Mon Sep 17 00:00:00 2001 From: Fenris Wolf Date: Mon, 22 Sep 2025 00:59:32 +0200 Subject: [PATCH] [mod] structure:r4 [add] migration:r3-r4:postgresql --- source/migrations/r3-r4.postgresql.sql | 49 ++++++++++++++++++++++++++ source/structure/r4.sindri.json | 11 ++---- 2 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 source/migrations/r3-r4.postgresql.sql diff --git a/source/migrations/r3-r4.postgresql.sql b/source/migrations/r3-r4.postgresql.sql new file mode 100644 index 0000000..6366936 --- /dev/null +++ b/source/migrations/r3-r4.postgresql.sql @@ -0,0 +1,49 @@ +-- users + +ALTER TABLE + "users" +ADD COLUMN + "dav_token" VARCHAR(255) +; + + +-- caldav_resources + +ALTER TABLE + "caldav_resources" +RENAME TO + "ics_feed_resources" +; + +ALTER TABLE + "ics_feed_resources" +DROP COLUMN + "read_only" +; + +ALTER TABLE + "ics_feed_resources" +ADD COLUMN + "from_fucked_up_wordpress" BOOLEAN NOT NULL +; + +COMMENT ON COLUMN + "resources"."kind" +IS + '»local« | »ics_feed«' +; + +COMMENT ON COLUMN + "resources"."sub_id" +IS + 'local_resources.id | ics_feed_resources.id' +; + + +-- _meta + +UPDATE + "_meta" +SET + "revision" = 'r4' +; diff --git a/source/structure/r4.sindri.json b/source/structure/r4.sindri.json index f3ae8db..9ccc04c 100644 --- a/source/structure/r4.sindri.json +++ b/source/structure/r4.sindri.json @@ -150,7 +150,7 @@ ] }, { - "name": "caldav_resources", + "name": "ics_feed_resources", "key_field": { "name": "id" }, @@ -160,11 +160,6 @@ "type": "string_medium", "nullable": false }, - { - "name": "read_only", - "type": "boolean", - "nullable": false - }, { "name": "from_fucked_up_wordpress", "type": "boolean", @@ -184,13 +179,13 @@ "name": "kind", "type": "string_short", "nullable": false, - "description": "»local« | »caldav«" + "description": "»local« | »ics_feed«" }, { "name": "sub_id", "type": "integer", "nullable": false, - "description": "local_resources.id | caldav_resources.id" + "description": "local_resources.id | ics_feed_resources.id" } ], "constraints": [