From c0f892cae55fb70df02946441a2c32a075e9a59d Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Thu, 11 Jun 2026 14:28:08 -0400 Subject: [PATCH] fix(db): squash migrations to single baseline (cold-migrate was broken) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0000_easy_slipstream already created lists/list_shares/list_items and the calendars unique constraint, but 0001_lists_schema re-created those tables and 0001_calendars_user_url_unique was an orphan (not in _journal) — so a cold `drizzle-kit migrate` against an empty DB failed with ERROR 1050 'Table lists already exists'. Dev only survived because its DB was built incrementally; CI is the first cold migrate and exposed it. Regenerated a single 0000_baseline.sql from schema.ts. Verified on a fresh mariadb:11: migrate succeeds, schema is structurally identical to the running dev DB, `drizzle-kit generate` reports no drift, and all 238 API tests pass. Local dev DBs must be rebuilt (drop + db:migrate); no prod exists. --- ..._easy_slipstream.sql => 0000_baseline.sql} | 19 +- .../0001_calendars_user_url_unique.sql | 41 - .../src/db/migrations/0001_lists_schema.sql | 44 - .../0002_yielding_mattie_franklin.sql | 1 - .../api/src/db/migrations/0003_same_xavin.sql | 15 - .../src/db/migrations/0004_mature_maximus.sql | 2 - .../src/db/migrations/meta/0000_snapshot.json | 109 +- .../src/db/migrations/meta/0002_snapshot.json | 864 ---------------- .../src/db/migrations/meta/0003_snapshot.json | 969 ------------------ .../src/db/migrations/meta/0004_snapshot.json | 969 ------------------ apps/api/src/db/migrations/meta/_journal.json | 32 +- 11 files changed, 126 insertions(+), 2939 deletions(-) rename apps/api/src/db/migrations/{0000_easy_slipstream.sql => 0000_baseline.sql} (87%) delete mode 100644 apps/api/src/db/migrations/0001_calendars_user_url_unique.sql delete mode 100644 apps/api/src/db/migrations/0001_lists_schema.sql delete mode 100644 apps/api/src/db/migrations/0002_yielding_mattie_franklin.sql delete mode 100644 apps/api/src/db/migrations/0003_same_xavin.sql delete mode 100644 apps/api/src/db/migrations/0004_mature_maximus.sql delete mode 100644 apps/api/src/db/migrations/meta/0002_snapshot.json delete mode 100644 apps/api/src/db/migrations/meta/0003_snapshot.json delete mode 100644 apps/api/src/db/migrations/meta/0004_snapshot.json diff --git a/apps/api/src/db/migrations/0000_easy_slipstream.sql b/apps/api/src/db/migrations/0000_baseline.sql similarity index 87% rename from apps/api/src/db/migrations/0000_easy_slipstream.sql rename to apps/api/src/db/migrations/0000_baseline.sql index 552e9c5..d239477 100644 --- a/apps/api/src/db/migrations/0000_easy_slipstream.sql +++ b/apps/api/src/db/migrations/0000_baseline.sql @@ -5,6 +5,7 @@ CREATE TABLE `calendar_events` ( `etag` varchar(256), `object_url` varchar(1024), `raw_vevent` text NOT NULL, + `title` varchar(500), `dtstart_utc` timestamp, `dtstart_date` date, `all_day` boolean NOT NULL DEFAULT false, @@ -52,7 +53,7 @@ CREATE TABLE `list_items` ( `list_id` int NOT NULL, `text` varchar(500) NOT NULL, `checked` boolean NOT NULL DEFAULT false, - `rank` varchar(255) NOT NULL, + `rank` varchar(255) COLLATE utf8mb4_bin NOT NULL, `created_at` timestamp NOT NULL DEFAULT (now()), `updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP, CONSTRAINT `list_items_id` PRIMARY KEY(`id`) @@ -87,6 +88,18 @@ CREATE TABLE `member_credentials` ( CONSTRAINT `member_credentials_id` PRIMARY KEY(`id`) ); --> statement-breakpoint +CREATE TABLE `push_subscriptions` ( + `id` int AUTO_INCREMENT NOT NULL, + `user_id` int NOT NULL, + `endpoint` varchar(2048) NOT NULL, + `p256dh` varchar(512) NOT NULL, + `auth` varchar(256) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT (now()), + `updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT `push_subscriptions_id` PRIMARY KEY(`id`), + CONSTRAINT `uniq_push_endpoint` UNIQUE(`endpoint`) +); +--> statement-breakpoint CREATE TABLE `users` ( `id` int AUTO_INCREMENT NOT NULL, `oidc_iss` varchar(512) NOT NULL, @@ -106,6 +119,7 @@ ALTER TABLE `list_shares` ADD CONSTRAINT `list_shares_list_id_lists_id_fk` FOREI ALTER TABLE `list_shares` ADD CONSTRAINT `list_shares_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE `lists` ADD CONSTRAINT `lists_owner_id_users_id_fk` FOREIGN KEY (`owner_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE `member_credentials` ADD CONSTRAINT `member_credentials_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE `push_subscriptions` ADD CONSTRAINT `push_subscriptions_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint CREATE INDEX `idx_calendar_events_dtstart_utc` ON `calendar_events` (`dtstart_utc`);--> statement-breakpoint CREATE INDEX `idx_calendar_events_dtstart_date` ON `calendar_events` (`dtstart_date`);--> statement-breakpoint CREATE INDEX `idx_calendar_events_has_rrule` ON `calendar_events` (`has_rrule`);--> statement-breakpoint @@ -117,4 +131,5 @@ CREATE INDEX `idx_list_items_list_id_rank` ON `list_items` (`list_id`,`rank`);-- CREATE INDEX `idx_list_items_list_id_checked` ON `list_items` (`list_id`,`checked`);--> statement-breakpoint CREATE INDEX `idx_list_shares_user_id` ON `list_shares` (`user_id`);--> statement-breakpoint CREATE INDEX `idx_lists_owner_id` ON `lists` (`owner_id`);--> statement-breakpoint -CREATE INDEX `idx_member_credentials_user_id` ON `member_credentials` (`user_id`); \ No newline at end of file +CREATE INDEX `idx_member_credentials_user_id` ON `member_credentials` (`user_id`);--> statement-breakpoint +CREATE INDEX `idx_push_subscriptions_user_id` ON `push_subscriptions` (`user_id`); \ No newline at end of file diff --git a/apps/api/src/db/migrations/0001_calendars_user_url_unique.sql b/apps/api/src/db/migrations/0001_calendars_user_url_unique.sql deleted file mode 100644 index 5ec3d93..0000000 --- a/apps/api/src/db/migrations/0001_calendars_user_url_unique.sql +++ /dev/null @@ -1,41 +0,0 @@ --- BUG B — calendars: add composite unique key (user_id, url). --- --- Context (D-16): the two household members share ONE Fastmail account, so the --- SAME collection URL is polled by both credentials. The calendar upsert keyed on --- url alone never triggered onDuplicateKeyUpdate (no unique key on url), so every --- poll inserted a fresh calendar row; the url-only lookup then resolved to the --- other member's row, caching events under the wrong calendarId. --- --- This migration is hand-written (not drizzle-kit generated) because drizzle-kit --- push is unsafe on populated MariaDB (false destructive diffs) and there is no --- migrations baseline. Apply it directly to the live DB before/with the image --- rebuild that ships the schema + broker fixes. --- --- Order matters: duplicate (user_id, url) rows must be collapsed BEFORE the unique --- key is added, or ADD UNIQUE fails. We keep the LOWEST id per (user_id, url), --- repoint any cached events from the loser rows onto the keeper, then delete losers. - --- 1. Repoint calendar_events from duplicate calendar rows onto the keeper --- (lowest id) for each (user_id, url) group. -UPDATE calendar_events ce -JOIN calendars dup ON dup.id = ce.calendar_id -JOIN ( - SELECT user_id, url, MIN(id) AS keep_id - FROM calendars - GROUP BY user_id, url -) keeper ON keeper.user_id = dup.user_id AND keeper.url = dup.url -SET ce.calendar_id = keeper.keep_id -WHERE ce.calendar_id <> keeper.keep_id; - --- 2. Delete the duplicate (loser) calendar rows, keeping the lowest id per group. -DELETE c FROM calendars c -JOIN ( - SELECT user_id, url, MIN(id) AS keep_id - FROM calendars - GROUP BY user_id, url -) keeper ON keeper.user_id = c.user_id AND keeper.url = c.url -WHERE c.id <> keeper.keep_id; - --- 3. Add the composite unique key that makes the upsert idempotent per (user_id, url). -ALTER TABLE calendars - ADD CONSTRAINT uniq_calendar_user_url UNIQUE (user_id, url); diff --git a/apps/api/src/db/migrations/0001_lists_schema.sql b/apps/api/src/db/migrations/0001_lists_schema.sql deleted file mode 100644 index a7ff1fe..0000000 --- a/apps/api/src/db/migrations/0001_lists_schema.sql +++ /dev/null @@ -1,44 +0,0 @@ --- Phase 4: Add lists, list_shares, list_items tables. --- Additive migration only — no DROP, TRUNCATE, or ALTER of existing tables. --- --- D-01: lists.is_shared defaults to true (collaborative household use case) --- D-02: list_shares join table is member-count-agnostic --- D-13: list_items.rank is a fractional-indexing varchar string -CREATE TABLE `lists` ( - `id` int AUTO_INCREMENT NOT NULL, - `owner_id` int NOT NULL, - `name` varchar(255) NOT NULL, - `is_shared` boolean NOT NULL DEFAULT true, - `created_at` timestamp NOT NULL DEFAULT (now()), - `updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `lists_id` PRIMARY KEY(`id`) -); ---> statement-breakpoint -CREATE TABLE `list_shares` ( - `id` int AUTO_INCREMENT NOT NULL, - `list_id` int NOT NULL, - `user_id` int NOT NULL, - `created_at` timestamp NOT NULL DEFAULT (now()), - CONSTRAINT `list_shares_id` PRIMARY KEY(`id`), - CONSTRAINT `uniq_list_share` UNIQUE(`list_id`,`user_id`) -); ---> statement-breakpoint -CREATE TABLE `list_items` ( - `id` int AUTO_INCREMENT NOT NULL, - `list_id` int NOT NULL, - `text` varchar(500) NOT NULL, - `checked` boolean NOT NULL DEFAULT false, - `rank` varchar(255) NOT NULL, - `created_at` timestamp NOT NULL DEFAULT (now()), - `updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `list_items_id` PRIMARY KEY(`id`) -); ---> statement-breakpoint -ALTER TABLE `lists` ADD CONSTRAINT `lists_owner_id_users_id_fk` FOREIGN KEY (`owner_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE `list_shares` ADD CONSTRAINT `list_shares_list_id_lists_id_fk` FOREIGN KEY (`list_id`) REFERENCES `lists`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE `list_shares` ADD CONSTRAINT `list_shares_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE `list_items` ADD CONSTRAINT `list_items_list_id_lists_id_fk` FOREIGN KEY (`list_id`) REFERENCES `lists`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX `idx_lists_owner_id` ON `lists` (`owner_id`);--> statement-breakpoint -CREATE INDEX `idx_list_shares_user_id` ON `list_shares` (`user_id`);--> statement-breakpoint -CREATE INDEX `idx_list_items_list_id_rank` ON `list_items` (`list_id`,`rank`);--> statement-breakpoint -CREATE INDEX `idx_list_items_list_id_checked` ON `list_items` (`list_id`,`checked`); diff --git a/apps/api/src/db/migrations/0002_yielding_mattie_franklin.sql b/apps/api/src/db/migrations/0002_yielding_mattie_franklin.sql deleted file mode 100644 index 2c1aa71..0000000 --- a/apps/api/src/db/migrations/0002_yielding_mattie_franklin.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `list_items` MODIFY COLUMN `rank` varchar(255) COLLATE utf8mb4_bin NOT NULL; \ No newline at end of file diff --git a/apps/api/src/db/migrations/0003_same_xavin.sql b/apps/api/src/db/migrations/0003_same_xavin.sql deleted file mode 100644 index 15a91e9..0000000 --- a/apps/api/src/db/migrations/0003_same_xavin.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE `push_subscriptions` ( - `id` int AUTO_INCREMENT NOT NULL, - `user_id` int NOT NULL, - `endpoint` text NOT NULL, - `p256dh` text NOT NULL, - `auth` varchar(256) NOT NULL, - `created_at` timestamp NOT NULL DEFAULT (now()), - `updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP, - CONSTRAINT `push_subscriptions_id` PRIMARY KEY(`id`), - CONSTRAINT `uniq_push_endpoint` UNIQUE(`endpoint`) -); ---> statement-breakpoint -ALTER TABLE `calendar_events` ADD `title` varchar(500);--> statement-breakpoint -ALTER TABLE `push_subscriptions` ADD CONSTRAINT `push_subscriptions_user_id_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX `idx_push_subscriptions_user_id` ON `push_subscriptions` (`user_id`); \ No newline at end of file diff --git a/apps/api/src/db/migrations/0004_mature_maximus.sql b/apps/api/src/db/migrations/0004_mature_maximus.sql deleted file mode 100644 index 2a9546d..0000000 --- a/apps/api/src/db/migrations/0004_mature_maximus.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `push_subscriptions` MODIFY COLUMN `endpoint` varchar(2048) NOT NULL;--> statement-breakpoint -ALTER TABLE `push_subscriptions` MODIFY COLUMN `p256dh` varchar(512) NOT NULL; \ No newline at end of file diff --git a/apps/api/src/db/migrations/meta/0000_snapshot.json b/apps/api/src/db/migrations/meta/0000_snapshot.json index ac705a4..e39d06c 100644 --- a/apps/api/src/db/migrations/meta/0000_snapshot.json +++ b/apps/api/src/db/migrations/meta/0000_snapshot.json @@ -1,7 +1,7 @@ { "version": "5", "dialect": "mysql", - "id": "e4665da0-ef95-4994-af4a-0d6a0169c874", + "id": "f296f762-5b02-4743-9758-a5b01f11754e", "prevId": "00000000-0000-0000-0000-000000000000", "tables": { "calendar_events": { @@ -49,6 +49,13 @@ "notNull": true, "autoincrement": false }, + "title": { + "name": "title", + "type": "varchar(500)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, "dtstart_utc": { "name": "dtstart_utc", "type": "timestamp", @@ -457,7 +464,7 @@ }, "rank": { "name": "rank", - "type": "varchar(255)", + "type": "varchar(255) COLLATE utf8mb4_bin", "primaryKey": false, "notNull": true, "autoincrement": false @@ -782,6 +789,104 @@ "uniqueConstraints": {}, "checkConstraint": {} }, + "push_subscriptions": { + "name": "push_subscriptions", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "user_id": { + "name": "user_id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "endpoint": { + "name": "endpoint", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "p256dh": { + "name": "p256dh", + "type": "varchar(512)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "auth": { + "name": "auth", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "onUpdate": true, + "default": "(now())" + } + }, + "indexes": { + "idx_push_subscriptions_user_id": { + "name": "idx_push_subscriptions_user_id", + "columns": [ + "user_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "push_subscriptions_user_id_users_id_fk": { + "name": "push_subscriptions_user_id_users_id_fk", + "tableFrom": "push_subscriptions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "push_subscriptions_id": { + "name": "push_subscriptions_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": { + "uniq_push_endpoint": { + "name": "uniq_push_endpoint", + "columns": [ + "endpoint" + ] + } + }, + "checkConstraint": {} + }, "users": { "name": "users", "columns": { diff --git a/apps/api/src/db/migrations/meta/0002_snapshot.json b/apps/api/src/db/migrations/meta/0002_snapshot.json deleted file mode 100644 index e3b9a21..0000000 --- a/apps/api/src/db/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,864 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "3a73e735-2d98-4ddb-b68a-fc1a3e6a81e8", - "prevId": "e4665da0-ef95-4994-af4a-0d6a0169c874", - "tables": { - "calendar_events": { - "name": "calendar_events", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "calendar_id": { - "name": "calendar_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "object_url": { - "name": "object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "raw_vevent": { - "name": "raw_vevent", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "dtstart_utc": { - "name": "dtstart_utc", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dtstart_date": { - "name": "dtstart_date", - "type": "date", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "all_day": { - "name": "all_day", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "has_rrule": { - "name": "has_rrule", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_calendar_events_dtstart_utc": { - "name": "idx_calendar_events_dtstart_utc", - "columns": [ - "dtstart_utc" - ], - "isUnique": false - }, - "idx_calendar_events_dtstart_date": { - "name": "idx_calendar_events_dtstart_date", - "columns": [ - "dtstart_date" - ], - "isUnique": false - }, - "idx_calendar_events_has_rrule": { - "name": "idx_calendar_events_has_rrule", - "columns": [ - "has_rrule" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_events_calendar_id_calendars_id_fk": { - "name": "calendar_events_calendar_id_calendars_id_fk", - "tableFrom": "calendar_events", - "tableTo": "calendars", - "columnsFrom": [ - "calendar_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_events_id": { - "name": "calendar_events_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_uid": { - "name": "uniq_calendar_uid", - "columns": [ - "calendar_id", - "uid" - ] - } - }, - "checkConstraint": {} - }, - "calendar_outbox": { - "name": "calendar_outbox", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "enum('create','update','delete')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "enum('pending','done','failed','dead')", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'pending'" - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_url": { - "name": "calendar_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_object_url": { - "name": "calendar_object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payload": { - "name": "payload", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "attempt_count": { - "name": "attempt_count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_outbox_user_status": { - "name": "idx_outbox_user_status", - "columns": [ - "user_id", - "status" - ], - "isUnique": false - }, - "idx_outbox_next_attempt": { - "name": "idx_outbox_next_attempt", - "columns": [ - "next_attempt_at", - "status" - ], - "isUnique": false - }, - "idx_outbox_uid": { - "name": "idx_outbox_uid", - "columns": [ - "uid" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_outbox_user_id_users_id_fk": { - "name": "calendar_outbox_user_id_users_id_fk", - "tableFrom": "calendar_outbox", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_outbox_id": { - "name": "calendar_outbox_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "calendars": { - "name": "calendars", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ctag": { - "name": "ctag", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sync_token": { - "name": "sync_token", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_synced_at": { - "name": "last_synced_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": { - "idx_calendars_user_id": { - "name": "idx_calendars_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendars_user_id_users_id_fk": { - "name": "calendars_user_id_users_id_fk", - "tableFrom": "calendars", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendars_id": { - "name": "calendars_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_user_url": { - "name": "uniq_calendar_user_url", - "columns": [ - "user_id", - "url" - ] - } - }, - "checkConstraint": {} - }, - "list_items": { - "name": "list_items", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "text": { - "name": "text", - "type": "varchar(500)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "checked": { - "name": "checked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "rank": { - "name": "rank", - "type": "varchar(255) COLLATE utf8mb4_bin", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_list_items_list_id_rank": { - "name": "idx_list_items_list_id_rank", - "columns": [ - "list_id", - "rank" - ], - "isUnique": false - }, - "idx_list_items_list_id_checked": { - "name": "idx_list_items_list_id_checked", - "columns": [ - "list_id", - "checked" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_items_list_id_lists_id_fk": { - "name": "list_items_list_id_lists_id_fk", - "tableFrom": "list_items", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_items_id": { - "name": "list_items_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "list_shares": { - "name": "list_shares", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": { - "idx_list_shares_user_id": { - "name": "idx_list_shares_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_shares_list_id_lists_id_fk": { - "name": "list_shares_list_id_lists_id_fk", - "tableFrom": "list_shares", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_shares_user_id_users_id_fk": { - "name": "list_shares_user_id_users_id_fk", - "tableFrom": "list_shares", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_shares_id": { - "name": "list_shares_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_list_share": { - "name": "uniq_list_share", - "columns": [ - "list_id", - "user_id" - ] - } - }, - "checkConstraint": {} - }, - "lists": { - "name": "lists", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "owner_id": { - "name": "owner_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_lists_owner_id": { - "name": "idx_lists_owner_id", - "columns": [ - "owner_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "lists_owner_id_users_id_fk": { - "name": "lists_owner_id_users_id_fk", - "tableFrom": "lists", - "tableTo": "users", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "lists_id": { - "name": "lists_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "member_credentials": { - "name": "member_credentials", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "encrypted_password": { - "name": "encrypted_password", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "fastmail_email": { - "name": "fastmail_email", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_member_credentials_user_id": { - "name": "idx_member_credentials_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "member_credentials_user_id_users_id_fk": { - "name": "member_credentials_user_id_users_id_fk", - "tableFrom": "member_credentials", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "member_credentials_id": { - "name": "member_credentials_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "users": { - "name": "users", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "oidc_iss": { - "name": "oidc_iss", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "oidc_sub": { - "name": "oidc_sub", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "users_id": { - "name": "users_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_oidc_identity": { - "name": "uniq_oidc_identity", - "columns": [ - "oidc_iss", - "oidc_sub" - ] - } - }, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} \ No newline at end of file diff --git a/apps/api/src/db/migrations/meta/0003_snapshot.json b/apps/api/src/db/migrations/meta/0003_snapshot.json deleted file mode 100644 index bc249d9..0000000 --- a/apps/api/src/db/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,969 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "091236ec-ff3a-4982-8e9d-022a398f24f9", - "prevId": "3a73e735-2d98-4ddb-b68a-fc1a3e6a81e8", - "tables": { - "calendar_events": { - "name": "calendar_events", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "calendar_id": { - "name": "calendar_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "object_url": { - "name": "object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "raw_vevent": { - "name": "raw_vevent", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "varchar(500)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dtstart_utc": { - "name": "dtstart_utc", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dtstart_date": { - "name": "dtstart_date", - "type": "date", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "all_day": { - "name": "all_day", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "has_rrule": { - "name": "has_rrule", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_calendar_events_dtstart_utc": { - "name": "idx_calendar_events_dtstart_utc", - "columns": [ - "dtstart_utc" - ], - "isUnique": false - }, - "idx_calendar_events_dtstart_date": { - "name": "idx_calendar_events_dtstart_date", - "columns": [ - "dtstart_date" - ], - "isUnique": false - }, - "idx_calendar_events_has_rrule": { - "name": "idx_calendar_events_has_rrule", - "columns": [ - "has_rrule" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_events_calendar_id_calendars_id_fk": { - "name": "calendar_events_calendar_id_calendars_id_fk", - "tableFrom": "calendar_events", - "tableTo": "calendars", - "columnsFrom": [ - "calendar_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_events_id": { - "name": "calendar_events_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_uid": { - "name": "uniq_calendar_uid", - "columns": [ - "calendar_id", - "uid" - ] - } - }, - "checkConstraint": {} - }, - "calendar_outbox": { - "name": "calendar_outbox", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "enum('create','update','delete')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "enum('pending','done','failed','dead')", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'pending'" - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_url": { - "name": "calendar_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_object_url": { - "name": "calendar_object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payload": { - "name": "payload", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "attempt_count": { - "name": "attempt_count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_outbox_user_status": { - "name": "idx_outbox_user_status", - "columns": [ - "user_id", - "status" - ], - "isUnique": false - }, - "idx_outbox_next_attempt": { - "name": "idx_outbox_next_attempt", - "columns": [ - "next_attempt_at", - "status" - ], - "isUnique": false - }, - "idx_outbox_uid": { - "name": "idx_outbox_uid", - "columns": [ - "uid" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_outbox_user_id_users_id_fk": { - "name": "calendar_outbox_user_id_users_id_fk", - "tableFrom": "calendar_outbox", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_outbox_id": { - "name": "calendar_outbox_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "calendars": { - "name": "calendars", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ctag": { - "name": "ctag", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sync_token": { - "name": "sync_token", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_synced_at": { - "name": "last_synced_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": { - "idx_calendars_user_id": { - "name": "idx_calendars_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendars_user_id_users_id_fk": { - "name": "calendars_user_id_users_id_fk", - "tableFrom": "calendars", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendars_id": { - "name": "calendars_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_user_url": { - "name": "uniq_calendar_user_url", - "columns": [ - "user_id", - "url" - ] - } - }, - "checkConstraint": {} - }, - "list_items": { - "name": "list_items", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "text": { - "name": "text", - "type": "varchar(500)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "checked": { - "name": "checked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "rank": { - "name": "rank", - "type": "varchar(255) COLLATE utf8mb4_bin", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_list_items_list_id_rank": { - "name": "idx_list_items_list_id_rank", - "columns": [ - "list_id", - "rank" - ], - "isUnique": false - }, - "idx_list_items_list_id_checked": { - "name": "idx_list_items_list_id_checked", - "columns": [ - "list_id", - "checked" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_items_list_id_lists_id_fk": { - "name": "list_items_list_id_lists_id_fk", - "tableFrom": "list_items", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_items_id": { - "name": "list_items_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "list_shares": { - "name": "list_shares", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": { - "idx_list_shares_user_id": { - "name": "idx_list_shares_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_shares_list_id_lists_id_fk": { - "name": "list_shares_list_id_lists_id_fk", - "tableFrom": "list_shares", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_shares_user_id_users_id_fk": { - "name": "list_shares_user_id_users_id_fk", - "tableFrom": "list_shares", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_shares_id": { - "name": "list_shares_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_list_share": { - "name": "uniq_list_share", - "columns": [ - "list_id", - "user_id" - ] - } - }, - "checkConstraint": {} - }, - "lists": { - "name": "lists", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "owner_id": { - "name": "owner_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_lists_owner_id": { - "name": "idx_lists_owner_id", - "columns": [ - "owner_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "lists_owner_id_users_id_fk": { - "name": "lists_owner_id_users_id_fk", - "tableFrom": "lists", - "tableTo": "users", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "lists_id": { - "name": "lists_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "member_credentials": { - "name": "member_credentials", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "encrypted_password": { - "name": "encrypted_password", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "fastmail_email": { - "name": "fastmail_email", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_member_credentials_user_id": { - "name": "idx_member_credentials_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "member_credentials_user_id_users_id_fk": { - "name": "member_credentials_user_id_users_id_fk", - "tableFrom": "member_credentials", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "member_credentials_id": { - "name": "member_credentials_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "push_subscriptions": { - "name": "push_subscriptions", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "endpoint": { - "name": "endpoint", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "p256dh": { - "name": "p256dh", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "auth": { - "name": "auth", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_push_subscriptions_user_id": { - "name": "idx_push_subscriptions_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "push_subscriptions_user_id_users_id_fk": { - "name": "push_subscriptions_user_id_users_id_fk", - "tableFrom": "push_subscriptions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "push_subscriptions_id": { - "name": "push_subscriptions_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_push_endpoint": { - "name": "uniq_push_endpoint", - "columns": [ - "endpoint" - ] - } - }, - "checkConstraint": {} - }, - "users": { - "name": "users", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "oidc_iss": { - "name": "oidc_iss", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "oidc_sub": { - "name": "oidc_sub", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "users_id": { - "name": "users_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_oidc_identity": { - "name": "uniq_oidc_identity", - "columns": [ - "oidc_iss", - "oidc_sub" - ] - } - }, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} \ No newline at end of file diff --git a/apps/api/src/db/migrations/meta/0004_snapshot.json b/apps/api/src/db/migrations/meta/0004_snapshot.json deleted file mode 100644 index 3a3e778..0000000 --- a/apps/api/src/db/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,969 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "ab410c4e-810d-47a0-861c-2ec172bb6ebc", - "prevId": "091236ec-ff3a-4982-8e9d-022a398f24f9", - "tables": { - "calendar_events": { - "name": "calendar_events", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "calendar_id": { - "name": "calendar_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "object_url": { - "name": "object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "raw_vevent": { - "name": "raw_vevent", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "varchar(500)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dtstart_utc": { - "name": "dtstart_utc", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dtstart_date": { - "name": "dtstart_date", - "type": "date", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "all_day": { - "name": "all_day", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "has_rrule": { - "name": "has_rrule", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_calendar_events_dtstart_utc": { - "name": "idx_calendar_events_dtstart_utc", - "columns": [ - "dtstart_utc" - ], - "isUnique": false - }, - "idx_calendar_events_dtstart_date": { - "name": "idx_calendar_events_dtstart_date", - "columns": [ - "dtstart_date" - ], - "isUnique": false - }, - "idx_calendar_events_has_rrule": { - "name": "idx_calendar_events_has_rrule", - "columns": [ - "has_rrule" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_events_calendar_id_calendars_id_fk": { - "name": "calendar_events_calendar_id_calendars_id_fk", - "tableFrom": "calendar_events", - "tableTo": "calendars", - "columnsFrom": [ - "calendar_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_events_id": { - "name": "calendar_events_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_uid": { - "name": "uniq_calendar_uid", - "columns": [ - "calendar_id", - "uid" - ] - } - }, - "checkConstraint": {} - }, - "calendar_outbox": { - "name": "calendar_outbox", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "enum('create','update','delete')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "enum('pending','done','failed','dead')", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'pending'" - }, - "uid": { - "name": "uid", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_url": { - "name": "calendar_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "calendar_object_url": { - "name": "calendar_object_url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "etag": { - "name": "etag", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payload": { - "name": "payload", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "attempt_count": { - "name": "attempt_count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_outbox_user_status": { - "name": "idx_outbox_user_status", - "columns": [ - "user_id", - "status" - ], - "isUnique": false - }, - "idx_outbox_next_attempt": { - "name": "idx_outbox_next_attempt", - "columns": [ - "next_attempt_at", - "status" - ], - "isUnique": false - }, - "idx_outbox_uid": { - "name": "idx_outbox_uid", - "columns": [ - "uid" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendar_outbox_user_id_users_id_fk": { - "name": "calendar_outbox_user_id_users_id_fk", - "tableFrom": "calendar_outbox", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendar_outbox_id": { - "name": "calendar_outbox_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "calendars": { - "name": "calendars", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ctag": { - "name": "ctag", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sync_token": { - "name": "sync_token", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_synced_at": { - "name": "last_synced_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": { - "idx_calendars_user_id": { - "name": "idx_calendars_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "calendars_user_id_users_id_fk": { - "name": "calendars_user_id_users_id_fk", - "tableFrom": "calendars", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "calendars_id": { - "name": "calendars_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_calendar_user_url": { - "name": "uniq_calendar_user_url", - "columns": [ - "user_id", - "url" - ] - } - }, - "checkConstraint": {} - }, - "list_items": { - "name": "list_items", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "text": { - "name": "text", - "type": "varchar(500)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "checked": { - "name": "checked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "rank": { - "name": "rank", - "type": "varchar(255) COLLATE utf8mb4_bin", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_list_items_list_id_rank": { - "name": "idx_list_items_list_id_rank", - "columns": [ - "list_id", - "rank" - ], - "isUnique": false - }, - "idx_list_items_list_id_checked": { - "name": "idx_list_items_list_id_checked", - "columns": [ - "list_id", - "checked" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_items_list_id_lists_id_fk": { - "name": "list_items_list_id_lists_id_fk", - "tableFrom": "list_items", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_items_id": { - "name": "list_items_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "list_shares": { - "name": "list_shares", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "list_id": { - "name": "list_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": { - "idx_list_shares_user_id": { - "name": "idx_list_shares_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "list_shares_list_id_lists_id_fk": { - "name": "list_shares_list_id_lists_id_fk", - "tableFrom": "list_shares", - "tableTo": "lists", - "columnsFrom": [ - "list_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_shares_user_id_users_id_fk": { - "name": "list_shares_user_id_users_id_fk", - "tableFrom": "list_shares", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "list_shares_id": { - "name": "list_shares_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_list_share": { - "name": "uniq_list_share", - "columns": [ - "list_id", - "user_id" - ] - } - }, - "checkConstraint": {} - }, - "lists": { - "name": "lists", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "owner_id": { - "name": "owner_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_shared": { - "name": "is_shared", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_lists_owner_id": { - "name": "idx_lists_owner_id", - "columns": [ - "owner_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "lists_owner_id_users_id_fk": { - "name": "lists_owner_id_users_id_fk", - "tableFrom": "lists", - "tableTo": "users", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "lists_id": { - "name": "lists_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "member_credentials": { - "name": "member_credentials", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "encrypted_password": { - "name": "encrypted_password", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "fastmail_email": { - "name": "fastmail_email", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_member_credentials_user_id": { - "name": "idx_member_credentials_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "member_credentials_user_id_users_id_fk": { - "name": "member_credentials_user_id_users_id_fk", - "tableFrom": "member_credentials", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "member_credentials_id": { - "name": "member_credentials_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "push_subscriptions": { - "name": "push_subscriptions", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "user_id": { - "name": "user_id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "endpoint": { - "name": "endpoint", - "type": "varchar(2048)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "p256dh": { - "name": "p256dh", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "auth": { - "name": "auth", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "onUpdate": true, - "default": "(now())" - } - }, - "indexes": { - "idx_push_subscriptions_user_id": { - "name": "idx_push_subscriptions_user_id", - "columns": [ - "user_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "push_subscriptions_user_id_users_id_fk": { - "name": "push_subscriptions_user_id_users_id_fk", - "tableFrom": "push_subscriptions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "push_subscriptions_id": { - "name": "push_subscriptions_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_push_endpoint": { - "name": "uniq_push_endpoint", - "columns": [ - "endpoint" - ] - } - }, - "checkConstraint": {} - }, - "users": { - "name": "users", - "columns": { - "id": { - "name": "id", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": true - }, - "oidc_iss": { - "name": "oidc_iss", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "oidc_sub": { - "name": "oidc_sub", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "display_name": { - "name": "display_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "users_id": { - "name": "users_id", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "uniq_oidc_identity": { - "name": "uniq_oidc_identity", - "columns": [ - "oidc_iss", - "oidc_sub" - ] - } - }, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} \ No newline at end of file diff --git a/apps/api/src/db/migrations/meta/_journal.json b/apps/api/src/db/migrations/meta/_journal.json index 359d44e..ef83d68 100644 --- a/apps/api/src/db/migrations/meta/_journal.json +++ b/apps/api/src/db/migrations/meta/_journal.json @@ -5,36 +5,8 @@ { "idx": 0, "version": "5", - "when": 1781020239657, - "tag": "0000_easy_slipstream", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1781020500000, - "tag": "0001_lists_schema", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1781029240528, - "tag": "0002_yielding_mattie_franklin", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1781052360194, - "tag": "0003_same_xavin", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1781058250993, - "tag": "0004_mature_maximus", + "when": 1781202409890, + "tag": "0000_baseline", "breakpoints": true } ]