From b0fcd8b81be1c46d36d1b40892e278adedd43d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sat, 15 Aug 2026 15:32:37 +0000 Subject: [PATCH] stop tracking generated migrations, and delete the stale one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing applies these. There is no __drizzle_migrations table, `drizzle-kit migrate` has never run here, and `bun db:push` diffs the schema code against the live database directly — the schema code is the source of truth, as src/databases/CLAUDE.md says twice. The file was badly stale besides: 36 tables describing a schema from before capabilities, api_keys, agent_panels, the app store and the plugin system existed, including task_logs, terminal_containers and queue_jobs, which no longer exist anywhere in the codebase. Ignored rather than merely deleted, because `bun db:gen` reads src/schema.ts — whose last line imports plugin-schemas.gen.ts, generated from the plugin DIRECTORIES on whichever machine ran it. A committed migration would launder per-machine plugin state into the repository: generate it here and history gains music_* and offscale_*; generate it on a fresh clone and the next commit deletes them again. Two developers would fight over that file forever. Generating one locally to read a diff still works, and stays local. ── The history purge was tried and undone, deliberately ── git-filter-repo removed the blobs from all 1326 commits, cleanly: 1848 files became 1845, only the three migrations gone, every other blob byte-identical, verified against a bundle. It was reverted anyway. This codebase cites 76 commit SHAs as evidence — totality.ts points at 2873948 for the 2026-08-06 websocket incident, registry.ts at 044aacf4, CLAUDE.md at f35c145 for the /chat exemplar — and a rewrite changes every one. They survived locally only through 1,328 replace refs, which are local to one clone and fooled my own verification into reporting the pre-rewrite commit as already clean. Three stale files nobody reads in old commits are not worth 76 dangling citations in a codebase whose documentation works by pointing at the commit that proves the claim. Untracking gets the entire practical benefit: gone from the tree, ignored forever, never regenerated into git. Recorded so nobody spends the afternoon rediscovering it. --- .gitignore | 23 + .../migrations/0000_new_princess_powerful.sql | 426 --- .../migrations/meta/0000_snapshot.json | 2992 ----------------- .../officer_db/migrations/meta/_journal.json | 13 - 4 files changed, 23 insertions(+), 3431 deletions(-) delete mode 100644 src/databases/officer_db/migrations/0000_new_princess_powerful.sql delete mode 100644 src/databases/officer_db/migrations/meta/0000_snapshot.json delete mode 100644 src/databases/officer_db/migrations/meta/_journal.json diff --git a/.gitignore b/.gitignore index b33d5d65..ad23d306 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,26 @@ build/ build.next/ src/apps/officer-web/Plugins.gen.tsx src/databases/officer_db/src/plugin-schemas.gen.ts + +# drizzle-kit's generated migrations. Nothing applies them — there is no __drizzle_migrations table and +# `drizzle-kit migrate` has never been run here; `bun db:push` diffs the schema code against the live +# database and alters it directly. The schema code is the source of truth (src/databases/CLAUDE.md). +# +# Ignored rather than merely unused, because `bun db:gen` reads src/schema.ts — whose last line imports +# plugin-schemas.gen.ts, itself generated from the plugin DIRECTORIES on this machine. So a generated +# migration describes whichever plugins happen to be checked out here, and committing one would launder +# per-machine state into the repository: run it with music installed and history gains music_*; run it on +# a fresh clone and the next commit deletes them again. +# +# The old 0000_new_princess_powerful.sql is deleted from the WORKING TREE but left in history. It had 36 +# tables and described a schema from before capabilities, api_keys, the app store and the plugin system +# existed, including three (task_logs, terminal_containers, queue_jobs) that no longer exist at all. +# +# Purging it from history was tried on 2026-08-15 and deliberately undone. This codebase cites 76 commit +# SHAs in comments and docs as evidence — `totality.ts` points at 2873948 for the websocket incident, +# `registry.ts` at 044aacf4, CLAUDE.md at f35c145 — and a filter-repo run rewrites every one of them. +# Three stale files nobody reads in old commits are not worth 76 dangling citations in a codebase whose +# documentation works by pointing at the commit that proves the claim. +# +# Generate one locally whenever a diff is useful to read. It stays local. +src/databases/officer_db/migrations/ diff --git a/src/databases/officer_db/migrations/0000_new_princess_powerful.sql b/src/databases/officer_db/migrations/0000_new_princess_powerful.sql deleted file mode 100644 index 8161eaf3..00000000 --- a/src/databases/officer_db/migrations/0000_new_princess_powerful.sql +++ /dev/null @@ -1,426 +0,0 @@ -CREATE TABLE "passkey_challenges" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "origin" text NOT NULL, - "challenge" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "expires_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "passkeys" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "origin" text, - "credential_id" text, - "public_key" text, - "counter" integer DEFAULT 0 NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "token_blacklist" ( - "jti" text PRIMARY KEY NOT NULL, - "expires_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "users" ( - "id" serial PRIMARY KEY NOT NULL, - "email" text NOT NULL, - "password" text, - "status" text DEFAULT 'Unverified' NOT NULL, - "name" text, - "username" text, - "avatar" text, - "password_changed_at" timestamp with time zone, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "users_email_unique" UNIQUE("email"), - CONSTRAINT "users_username_unique" UNIQUE("username") -); ---> statement-breakpoint -CREATE TABLE "chat_session_events" ( - "id" bigserial PRIMARY KEY NOT NULL, - "session_id" text NOT NULL, - "event" jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "dashboard_defaults" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "terminals" jsonb DEFAULT '{}'::jsonb NOT NULL, - "host_terminals" jsonb DEFAULT '{}'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "dashboard_defaults_user_id_unique" UNIQUE("user_id") -); ---> statement-breakpoint -CREATE TABLE "dashboards" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "name" text NOT NULL, - "config" jsonb DEFAULT '{}'::jsonb NOT NULL, - "layout" jsonb DEFAULT '[]'::jsonb NOT NULL, - "terminals" jsonb DEFAULT '[]'::jsonb NOT NULL, - "host_terminals" jsonb DEFAULT '[]'::jsonb NOT NULL, - "sort_order" integer DEFAULT 0 NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_dashboards_user_id" UNIQUE("user_id","id") -); ---> statement-breakpoint -CREATE TABLE "screens" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "name" text NOT NULL, - "layout" jsonb DEFAULT '[]'::jsonb NOT NULL, - "terminals" jsonb DEFAULT '{}'::jsonb NOT NULL, - "host_terminals" jsonb DEFAULT '{}'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_screens_user_name" UNIQUE("user_id","name") -); ---> statement-breakpoint -CREATE TABLE "email_accounts" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "provider" text NOT NULL, - "email" text NOT NULL, - "display_name" text, - "imap_host" text NOT NULL, - "imap_port" integer NOT NULL, - "imap_secure" boolean DEFAULT true NOT NULL, - "auth_type" text NOT NULL, - "credentials" jsonb DEFAULT '{}'::jsonb NOT NULL, - "enabled" boolean DEFAULT true NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "status" text DEFAULT 'connected' NOT NULL, - "sync_meta" jsonb DEFAULT '{}'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_email_accounts_user_email" UNIQUE("user_id","email") -); ---> statement-breakpoint -CREATE TABLE "headscale_servers" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "name" text NOT NULL, - "url" text NOT NULL, - "api_key" text NOT NULL, - "version" text, - "is_active" boolean DEFAULT false NOT NULL, - "last_seen_at" timestamp with time zone, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_headscale_servers_user_url" UNIQUE("user_id","url") -); ---> statement-breakpoint -CREATE TABLE "music_favorites" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "kind" text NOT NULL, - "key" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_music_favorites_user_kind_key" UNIQUE("user_id","kind","key") -); ---> statement-breakpoint -CREATE TABLE "music_now_playing" ( - "user_id" integer NOT NULL, - "device" text DEFAULT '' NOT NULL, - "home_path" text NOT NULL, - "dir" text DEFAULT '' NOT NULL, - "title" text DEFAULT '' NOT NULL, - "artist" text DEFAULT '' NOT NULL, - "album" text DEFAULT '' NOT NULL, - "duration_sec" real DEFAULT 0 NOT NULL, - "position_sec" real DEFAULT 0 NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "music_now_playing_user_id_device_pk" PRIMARY KEY("user_id","device") -); ---> statement-breakpoint -CREATE TABLE "music_playlist_items" ( - "id" serial PRIMARY KEY NOT NULL, - "playlist_id" integer NOT NULL, - "key" text NOT NULL, - "position" integer NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "music_playlists" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "name" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_music_playlists_user_name" UNIQUE("user_id","name") -); ---> statement-breakpoint -CREATE TABLE "push_devices" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "token" text NOT NULL, - "platform" text NOT NULL, - "environment" text DEFAULT 'production' NOT NULL, - "bundle_id" text NOT NULL, - "app_slug" text NOT NULL, - "failure_count" integer DEFAULT 0 NOT NULL, - "last_seen_at" timestamp with time zone DEFAULT now() NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_push_devices_token_bundle" UNIQUE("token","bundle_id"), - CONSTRAINT "ck_push_devices_platform" CHECK ("push_devices"."platform" IN ('ios', 'android')), - CONSTRAINT "ck_push_devices_environment" CHECK ("push_devices"."environment" IN ('production', 'sandbox')) -); ---> statement-breakpoint -CREATE TABLE "queue_jobs" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "lane" text NOT NULL, - "type" text NOT NULL, - "status" text DEFAULT 'queued' NOT NULL, - "current_step" integer DEFAULT 0 NOT NULL, - "steps" jsonb DEFAULT '[]'::jsonb NOT NULL, - "meta" jsonb, - "error" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "started_at" timestamp with time zone, - "completed_at" timestamp with time zone -); ---> statement-breakpoint -CREATE TABLE "task_logs" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "task_name" text NOT NULL, - "task_dir_name" text NOT NULL, - "entry_name" text NOT NULL, - "entry_type" text NOT NULL, - "provider" text NOT NULL, - "model" text NOT NULL, - "is_error" boolean DEFAULT false NOT NULL, - "messages" jsonb DEFAULT '[]'::jsonb NOT NULL, - "started_at" timestamp with time zone NOT NULL, - "completed_at" timestamp with time zone -); ---> statement-breakpoint -CREATE TABLE "terminal_containers" ( - "user_id" integer PRIMARY KEY NOT NULL, - "docker_id" text NOT NULL, - "port" integer NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "photos_config" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "url" text NOT NULL, - "api_key" text NOT NULL, - "version" text, - "last_seen_at" timestamp with time zone, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "pipeline_jobs" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "task_dir_name" text NOT NULL, - "task_name" text NOT NULL, - "mode" text DEFAULT 'pipeline' NOT NULL, - "status" text DEFAULT 'pending' NOT NULL, - "inputs" jsonb DEFAULT '{}'::jsonb NOT NULL, - "cwd" text, - "config" jsonb NOT NULL, - "progress" jsonb, - "total_cost" jsonb, - "error" text, - "exit_code" integer, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "started_at" timestamp with time zone, - "completed_at" timestamp with time zone -); ---> statement-breakpoint -CREATE TABLE "server_config" ( - "key" text PRIMARY KEY NOT NULL, - "value" jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "server_integrations" ( - "id" serial PRIMARY KEY NOT NULL, - "provider" text NOT NULL, - "enabled" boolean DEFAULT true NOT NULL, - "config" jsonb DEFAULT '{}'::jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "server_integrations_provider_unique" UNIQUE("provider"), - CONSTRAINT "ck_server_integrations_provider" CHECK ("server_integrations"."provider" IN ('google', 'apify')) -); ---> statement-breakpoint -CREATE TABLE "soulseek_browse_dirs" ( - "id" serial PRIMARY KEY NOT NULL, - "snapshot_id" integer NOT NULL, - "name" text NOT NULL, - "parent_path" text, - "depth" integer DEFAULT 1 NOT NULL, - "label" text DEFAULT '' NOT NULL, - "child_count" integer DEFAULT 0 NOT NULL, - "file_count" integer DEFAULT 0 NOT NULL, - "total_size" bigint DEFAULT 0 NOT NULL, - "subtree_file_count" integer DEFAULT 0 NOT NULL, - "subtree_size" bigint DEFAULT 0 NOT NULL, - "files" jsonb DEFAULT '[]'::jsonb NOT NULL -); ---> statement-breakpoint -CREATE TABLE "soulseek_browse_snapshots" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "username" text NOT NULL, - "status" text DEFAULT 'pending' NOT NULL, - "error" text, - "directory_count" integer DEFAULT 0 NOT NULL, - "file_count" integer DEFAULT 0 NOT NULL, - "total_size" bigint DEFAULT 0 NOT NULL, - "started_at" timestamp with time zone DEFAULT now() NOT NULL, - "completed_at" timestamp with time zone, - CONSTRAINT "uq_soulseek_browse_snapshots_user_username" UNIQUE("user_id","username") -); ---> statement-breakpoint -CREATE TABLE "soulseek_favorites" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "username" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_soulseek_favorites_user_username" UNIQUE("user_id","username") -); ---> statement-breakpoint -CREATE TABLE "dock_configs" ( - "user_id" integer PRIMARY KEY NOT NULL, - "paths" jsonb DEFAULT '[]'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "user_integrations" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "provider" text NOT NULL, - "server_integration_id" integer, - "config" jsonb DEFAULT '{}'::jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_user_integrations_user_provider" UNIQUE("user_id","provider"), - CONSTRAINT "ck_user_integrations_provider" CHECK ("user_integrations"."provider" IN ('google', 'browser-relay')) -); ---> statement-breakpoint -CREATE TABLE "user_settings" ( - "user_id" integer PRIMARY KEY NOT NULL, - "settings" jsonb DEFAULT '{}'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "user_state" ( - "user_id" integer PRIMARY KEY NOT NULL, - "state" jsonb DEFAULT '{}'::jsonb NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "vault_tokens" ( - "user_id" integer PRIMARY KEY NOT NULL, - "access_token" text NOT NULL, - "refresh_token" text NOT NULL, - "expires_at" timestamp with time zone, - "device_identifier" text, - "client_id" text, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "vault_unlock_keys" ( - "user_id" integer PRIMARY KEY NOT NULL, - "wrapped_key" text NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "wallet_chain_cache" ( - "wallet_id" integer PRIMARY KEY NOT NULL, - "snapshot" jsonb, - "synced_at" timestamp with time zone, - "last_error" text, - "last_error_at" timestamp with time zone -); ---> statement-breakpoint -CREATE TABLE "wallet_frozen_utxos" ( - "id" serial PRIMARY KEY NOT NULL, - "wallet_id" integer NOT NULL, - "outpoint" text NOT NULL, - "reason" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_wallet_frozen_utxos_wallet_outpoint" UNIQUE("wallet_id","outpoint") -); ---> statement-breakpoint -CREATE TABLE "wallet_labels" ( - "id" serial PRIMARY KEY NOT NULL, - "wallet_id" integer NOT NULL, - "kind" text NOT NULL, - "ref" text NOT NULL, - "label" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_wallet_labels_wallet_kind_ref" UNIQUE("wallet_id","kind","ref") -); ---> statement-breakpoint -CREATE TABLE "wallet_wallets" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "name" text NOT NULL, - "kind" text NOT NULL, - "network" text DEFAULT 'bitcoin' NOT NULL, - "config" text, - "seed_envelope" text, - "fingerprint" text, - "xpubs" jsonb, - "default_bip" integer DEFAULT 84 NOT NULL, - "is_active" boolean DEFAULT false NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "uq_wallet_wallets_user_name" UNIQUE("user_id","name") -); ---> statement-breakpoint -ALTER TABLE "passkey_challenges" ADD CONSTRAINT "passkey_challenges_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "passkeys" ADD CONSTRAINT "passkeys_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "dashboard_defaults" ADD CONSTRAINT "dashboard_defaults_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "dashboards" ADD CONSTRAINT "dashboards_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "screens" ADD CONSTRAINT "screens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "email_accounts" ADD CONSTRAINT "email_accounts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "headscale_servers" ADD CONSTRAINT "headscale_servers_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "music_favorites" ADD CONSTRAINT "music_favorites_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "music_now_playing" ADD CONSTRAINT "music_now_playing_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "music_playlist_items" ADD CONSTRAINT "music_playlist_items_playlist_id_music_playlists_id_fk" FOREIGN KEY ("playlist_id") REFERENCES "public"."music_playlists"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "music_playlists" ADD CONSTRAINT "music_playlists_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "push_devices" ADD CONSTRAINT "push_devices_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "queue_jobs" ADD CONSTRAINT "queue_jobs_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "task_logs" ADD CONSTRAINT "task_logs_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "terminal_containers" ADD CONSTRAINT "terminal_containers_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "photos_config" ADD CONSTRAINT "photos_config_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "pipeline_jobs" ADD CONSTRAINT "pipeline_jobs_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "soulseek_browse_dirs" ADD CONSTRAINT "soulseek_browse_dirs_snapshot_id_fk" FOREIGN KEY ("snapshot_id") REFERENCES "public"."soulseek_browse_snapshots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "soulseek_browse_snapshots" ADD CONSTRAINT "soulseek_browse_snapshots_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "soulseek_favorites" ADD CONSTRAINT "soulseek_favorites_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "dock_configs" ADD CONSTRAINT "dock_configs_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "user_integrations" ADD CONSTRAINT "user_integrations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "user_integrations" ADD CONSTRAINT "user_integrations_server_integration_id_server_integrations_id_fk" FOREIGN KEY ("server_integration_id") REFERENCES "public"."server_integrations"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "user_settings" ADD CONSTRAINT "user_settings_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "user_state" ADD CONSTRAINT "user_state_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "vault_tokens" ADD CONSTRAINT "vault_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "vault_unlock_keys" ADD CONSTRAINT "vault_unlock_keys_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "wallet_chain_cache" ADD CONSTRAINT "wallet_chain_cache_wallet_id_wallet_wallets_id_fk" FOREIGN KEY ("wallet_id") REFERENCES "public"."wallet_wallets"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "wallet_frozen_utxos" ADD CONSTRAINT "wallet_frozen_utxos_wallet_id_wallet_wallets_id_fk" FOREIGN KEY ("wallet_id") REFERENCES "public"."wallet_wallets"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "wallet_labels" ADD CONSTRAINT "wallet_labels_wallet_id_wallet_wallets_id_fk" FOREIGN KEY ("wallet_id") REFERENCES "public"."wallet_wallets"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "wallet_wallets" ADD CONSTRAINT "wallet_wallets_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_token_blacklist_expires" ON "token_blacklist" USING btree ("expires_at");--> statement-breakpoint -CREATE INDEX "idx_chat_session_events_session_id" ON "chat_session_events" USING btree ("session_id","id");--> statement-breakpoint -CREATE UNIQUE INDEX "uq_headscale_servers_one_active" ON "headscale_servers" USING btree ("user_id") WHERE "headscale_servers"."is_active";--> statement-breakpoint -CREATE INDEX "idx_music_favorites_user_kind" ON "music_favorites" USING btree ("user_id","kind");--> statement-breakpoint -CREATE INDEX "idx_music_playlist_items_playlist" ON "music_playlist_items" USING btree ("playlist_id","position");--> statement-breakpoint -CREATE INDEX "idx_push_devices_user" ON "push_devices" USING btree ("user_id");--> statement-breakpoint -CREATE INDEX "idx_queue_jobs_status_lane" ON "queue_jobs" USING btree ("status","lane");--> statement-breakpoint -CREATE INDEX "idx_queue_jobs_user" ON "queue_jobs" USING btree ("user_id");--> statement-breakpoint -CREATE INDEX "idx_task_logs_user_started" ON "task_logs" USING btree ("user_id","started_at");--> statement-breakpoint -CREATE UNIQUE INDEX "photos_config_user_idx" ON "photos_config" USING btree ("user_id");--> statement-breakpoint -CREATE INDEX "idx_pipeline_jobs_user_created" ON "pipeline_jobs" USING btree ("user_id","created_at");--> statement-breakpoint -CREATE INDEX "idx_pipeline_jobs_status" ON "pipeline_jobs" USING btree ("status");--> statement-breakpoint -CREATE INDEX "idx_soulseek_browse_dirs_snapshot_name" ON "soulseek_browse_dirs" USING btree ("snapshot_id","name");--> statement-breakpoint -CREATE INDEX "idx_soulseek_browse_dirs_snapshot_parent" ON "soulseek_browse_dirs" USING btree ("snapshot_id","parent_path","name");--> statement-breakpoint -CREATE UNIQUE INDEX "uq_wallet_wallets_one_active" ON "wallet_wallets" USING btree ("user_id") WHERE "wallet_wallets"."is_active"; \ No newline at end of file diff --git a/src/databases/officer_db/migrations/meta/0000_snapshot.json b/src/databases/officer_db/migrations/meta/0000_snapshot.json deleted file mode 100644 index 6aa8f68a..00000000 --- a/src/databases/officer_db/migrations/meta/0000_snapshot.json +++ /dev/null @@ -1,2992 +0,0 @@ -{ - "id": "5de8ee68-0cd3-4e94-a2f7-7b110a88821f", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.passkey_challenges": { - "name": "passkey_challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "challenge": { - "name": "challenge", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "passkey_challenges_user_id_users_id_fk": { - "name": "passkey_challenges_user_id_users_id_fk", - "tableFrom": "passkey_challenges", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.passkeys": { - "name": "passkeys", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credential_id": { - "name": "credential_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "public_key": { - "name": "public_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "counter": { - "name": "counter", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "passkeys_user_id_users_id_fk": { - "name": "passkeys_user_id_users_id_fk", - "tableFrom": "passkeys", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_blacklist": { - "name": "token_blacklist", - "schema": "", - "columns": { - "jti": { - "name": "jti", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_token_blacklist_expires": { - "name": "idx_token_blacklist_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'Unverified'" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar": { - "name": "avatar", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password_changed_at": { - "name": "password_changed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.chat_session_events": { - "name": "chat_session_events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event": { - "name": "event", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_chat_session_events_session_id": { - "name": "idx_chat_session_events_session_id", - "columns": [ - { - "expression": "session_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dashboard_defaults": { - "name": "dashboard_defaults", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "terminals": { - "name": "terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "host_terminals": { - "name": "host_terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "dashboard_defaults_user_id_users_id_fk": { - "name": "dashboard_defaults_user_id_users_id_fk", - "tableFrom": "dashboard_defaults", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "dashboard_defaults_user_id_unique": { - "name": "dashboard_defaults_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dashboards": { - "name": "dashboards", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "config": { - "name": "config", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "layout": { - "name": "layout", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "terminals": { - "name": "terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "host_terminals": { - "name": "host_terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "sort_order": { - "name": "sort_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "dashboards_user_id_users_id_fk": { - "name": "dashboards_user_id_users_id_fk", - "tableFrom": "dashboards", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_dashboards_user_id": { - "name": "uq_dashboards_user_id", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.screens": { - "name": "screens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "layout": { - "name": "layout", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "terminals": { - "name": "terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "host_terminals": { - "name": "host_terminals", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "screens_user_id_users_id_fk": { - "name": "screens_user_id_users_id_fk", - "tableFrom": "screens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_screens_user_name": { - "name": "uq_screens_user_name", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.email_accounts": { - "name": "email_accounts", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "imap_host": { - "name": "imap_host", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imap_port": { - "name": "imap_port", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "imap_secure": { - "name": "imap_secure", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "auth_type": { - "name": "auth_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credentials": { - "name": "credentials", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'connected'" - }, - "sync_meta": { - "name": "sync_meta", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "email_accounts_user_id_users_id_fk": { - "name": "email_accounts_user_id_users_id_fk", - "tableFrom": "email_accounts", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_email_accounts_user_email": { - "name": "uq_email_accounts_user_email", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.headscale_servers": { - "name": "headscale_servers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_active": { - "name": "is_active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "uq_headscale_servers_one_active": { - "name": "uq_headscale_servers_one_active", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"headscale_servers\".\"is_active\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "headscale_servers_user_id_users_id_fk": { - "name": "headscale_servers_user_id_users_id_fk", - "tableFrom": "headscale_servers", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_headscale_servers_user_url": { - "name": "uq_headscale_servers_user_url", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "url" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.music_favorites": { - "name": "music_favorites", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_music_favorites_user_kind": { - "name": "idx_music_favorites_user_kind", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "music_favorites_user_id_users_id_fk": { - "name": "music_favorites_user_id_users_id_fk", - "tableFrom": "music_favorites", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_music_favorites_user_kind_key": { - "name": "uq_music_favorites_user_kind_key", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "kind", - "key" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.music_now_playing": { - "name": "music_now_playing", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "device": { - "name": "device", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "home_path": { - "name": "home_path", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "artist": { - "name": "artist", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "album": { - "name": "album", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "duration_sec": { - "name": "duration_sec", - "type": "real", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "position_sec": { - "name": "position_sec", - "type": "real", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "music_now_playing_user_id_users_id_fk": { - "name": "music_now_playing_user_id_users_id_fk", - "tableFrom": "music_now_playing", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "music_now_playing_user_id_device_pk": { - "name": "music_now_playing_user_id_device_pk", - "columns": [ - "user_id", - "device" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.music_playlist_items": { - "name": "music_playlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "playlist_id": { - "name": "playlist_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_music_playlist_items_playlist": { - "name": "idx_music_playlist_items_playlist", - "columns": [ - { - "expression": "playlist_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "position", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "music_playlist_items_playlist_id_music_playlists_id_fk": { - "name": "music_playlist_items_playlist_id_music_playlists_id_fk", - "tableFrom": "music_playlist_items", - "tableTo": "music_playlists", - "columnsFrom": [ - "playlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.music_playlists": { - "name": "music_playlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "music_playlists_user_id_users_id_fk": { - "name": "music_playlists_user_id_users_id_fk", - "tableFrom": "music_playlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_music_playlists_user_name": { - "name": "uq_music_playlists_user_name", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.push_devices": { - "name": "push_devices", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "platform": { - "name": "platform", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "environment": { - "name": "environment", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'production'" - }, - "bundle_id": { - "name": "bundle_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "app_slug": { - "name": "app_slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "failure_count": { - "name": "failure_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_push_devices_user": { - "name": "idx_push_devices_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "push_devices_user_id_users_id_fk": { - "name": "push_devices_user_id_users_id_fk", - "tableFrom": "push_devices", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_push_devices_token_bundle": { - "name": "uq_push_devices_token_bundle", - "nullsNotDistinct": false, - "columns": [ - "token", - "bundle_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "ck_push_devices_platform": { - "name": "ck_push_devices_platform", - "value": "\"push_devices\".\"platform\" IN ('ios', 'android')" - }, - "ck_push_devices_environment": { - "name": "ck_push_devices_environment", - "value": "\"push_devices\".\"environment\" IN ('production', 'sandbox')" - } - }, - "isRLSEnabled": false - }, - "public.queue_jobs": { - "name": "queue_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lane": { - "name": "lane", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'queued'" - }, - "current_step": { - "name": "current_step", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "steps": { - "name": "steps", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "meta": { - "name": "meta", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_queue_jobs_status_lane": { - "name": "idx_queue_jobs_status_lane", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lane", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_queue_jobs_user": { - "name": "idx_queue_jobs_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "queue_jobs_user_id_users_id_fk": { - "name": "queue_jobs_user_id_users_id_fk", - "tableFrom": "queue_jobs", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.task_logs": { - "name": "task_logs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "task_name": { - "name": "task_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "task_dir_name": { - "name": "task_dir_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "entry_name": { - "name": "entry_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "entry_type": { - "name": "entry_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_error": { - "name": "is_error", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_task_logs_user_started": { - "name": "idx_task_logs_user_started", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "started_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "task_logs_user_id_users_id_fk": { - "name": "task_logs_user_id_users_id_fk", - "tableFrom": "task_logs", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.terminal_containers": { - "name": "terminal_containers", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "docker_id": { - "name": "docker_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "port": { - "name": "port", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "terminal_containers_user_id_users_id_fk": { - "name": "terminal_containers_user_id_users_id_fk", - "tableFrom": "terminal_containers", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.photos_config": { - "name": "photos_config", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "photos_config_user_idx": { - "name": "photos_config_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "photos_config_user_id_users_id_fk": { - "name": "photos_config_user_id_users_id_fk", - "tableFrom": "photos_config", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.pipeline_jobs": { - "name": "pipeline_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "task_dir_name": { - "name": "task_dir_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "task_name": { - "name": "task_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "mode": { - "name": "mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pipeline'" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "inputs": { - "name": "inputs", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "cwd": { - "name": "cwd", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "config": { - "name": "config", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "progress": { - "name": "progress", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "total_cost": { - "name": "total_cost", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exit_code": { - "name": "exit_code", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_pipeline_jobs_user_created": { - "name": "idx_pipeline_jobs_user_created", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_pipeline_jobs_status": { - "name": "idx_pipeline_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "pipeline_jobs_user_id_users_id_fk": { - "name": "pipeline_jobs_user_id_users_id_fk", - "tableFrom": "pipeline_jobs", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.server_config": { - "name": "server_config", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.server_integrations": { - "name": "server_integrations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "config": { - "name": "config", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "server_integrations_provider_unique": { - "name": "server_integrations_provider_unique", - "nullsNotDistinct": false, - "columns": [ - "provider" - ] - } - }, - "policies": {}, - "checkConstraints": { - "ck_server_integrations_provider": { - "name": "ck_server_integrations_provider", - "value": "\"server_integrations\".\"provider\" IN ('google', 'apify')" - } - }, - "isRLSEnabled": false - }, - "public.soulseek_browse_dirs": { - "name": "soulseek_browse_dirs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "snapshot_id": { - "name": "snapshot_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_path": { - "name": "parent_path", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "depth": { - "name": "depth", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "child_count": { - "name": "child_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "file_count": { - "name": "file_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "total_size": { - "name": "total_size", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "subtree_file_count": { - "name": "subtree_file_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "subtree_size": { - "name": "subtree_size", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "files": { - "name": "files", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - } - }, - "indexes": { - "idx_soulseek_browse_dirs_snapshot_name": { - "name": "idx_soulseek_browse_dirs_snapshot_name", - "columns": [ - { - "expression": "snapshot_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_soulseek_browse_dirs_snapshot_parent": { - "name": "idx_soulseek_browse_dirs_snapshot_parent", - "columns": [ - { - "expression": "snapshot_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "parent_path", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "soulseek_browse_dirs_snapshot_id_fk": { - "name": "soulseek_browse_dirs_snapshot_id_fk", - "tableFrom": "soulseek_browse_dirs", - "tableTo": "soulseek_browse_snapshots", - "columnsFrom": [ - "snapshot_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.soulseek_browse_snapshots": { - "name": "soulseek_browse_snapshots", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "directory_count": { - "name": "directory_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "file_count": { - "name": "file_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "total_size": { - "name": "total_size", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "soulseek_browse_snapshots_user_id_users_id_fk": { - "name": "soulseek_browse_snapshots_user_id_users_id_fk", - "tableFrom": "soulseek_browse_snapshots", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_soulseek_browse_snapshots_user_username": { - "name": "uq_soulseek_browse_snapshots_user_username", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.soulseek_favorites": { - "name": "soulseek_favorites", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "soulseek_favorites_user_id_users_id_fk": { - "name": "soulseek_favorites_user_id_users_id_fk", - "tableFrom": "soulseek_favorites", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_soulseek_favorites_user_username": { - "name": "uq_soulseek_favorites_user_username", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dock_configs": { - "name": "dock_configs", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "paths": { - "name": "paths", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "dock_configs_user_id_users_id_fk": { - "name": "dock_configs_user_id_users_id_fk", - "tableFrom": "dock_configs", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_integrations": { - "name": "user_integrations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "server_integration_id": { - "name": "server_integration_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "config": { - "name": "config", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_integrations_user_id_users_id_fk": { - "name": "user_integrations_user_id_users_id_fk", - "tableFrom": "user_integrations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_integrations_server_integration_id_server_integrations_id_fk": { - "name": "user_integrations_server_integration_id_server_integrations_id_fk", - "tableFrom": "user_integrations", - "tableTo": "server_integrations", - "columnsFrom": [ - "server_integration_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_user_integrations_user_provider": { - "name": "uq_user_integrations_user_provider", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "provider" - ] - } - }, - "policies": {}, - "checkConstraints": { - "ck_user_integrations_provider": { - "name": "ck_user_integrations_provider", - "value": "\"user_integrations\".\"provider\" IN ('google', 'browser-relay')" - } - }, - "isRLSEnabled": false - }, - "public.user_settings": { - "name": "user_settings", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_settings_user_id_users_id_fk": { - "name": "user_settings_user_id_users_id_fk", - "tableFrom": "user_settings", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_state": { - "name": "user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "state": { - "name": "state", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_state_user_id_users_id_fk": { - "name": "user_state_user_id_users_id_fk", - "tableFrom": "user_state", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vault_tokens": { - "name": "vault_tokens", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "device_identifier": { - "name": "device_identifier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "vault_tokens_user_id_users_id_fk": { - "name": "vault_tokens_user_id_users_id_fk", - "tableFrom": "vault_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vault_unlock_keys": { - "name": "vault_unlock_keys", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "wrapped_key": { - "name": "wrapped_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "vault_unlock_keys_user_id_users_id_fk": { - "name": "vault_unlock_keys_user_id_users_id_fk", - "tableFrom": "vault_unlock_keys", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.wallet_chain_cache": { - "name": "wallet_chain_cache", - "schema": "", - "columns": { - "wallet_id": { - "name": "wallet_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "synced_at": { - "name": "synced_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "wallet_chain_cache_wallet_id_wallet_wallets_id_fk": { - "name": "wallet_chain_cache_wallet_id_wallet_wallets_id_fk", - "tableFrom": "wallet_chain_cache", - "tableTo": "wallet_wallets", - "columnsFrom": [ - "wallet_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.wallet_frozen_utxos": { - "name": "wallet_frozen_utxos", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "wallet_id": { - "name": "wallet_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "outpoint": { - "name": "outpoint", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wallet_frozen_utxos_wallet_id_wallet_wallets_id_fk": { - "name": "wallet_frozen_utxos_wallet_id_wallet_wallets_id_fk", - "tableFrom": "wallet_frozen_utxos", - "tableTo": "wallet_wallets", - "columnsFrom": [ - "wallet_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_wallet_frozen_utxos_wallet_outpoint": { - "name": "uq_wallet_frozen_utxos_wallet_outpoint", - "nullsNotDistinct": false, - "columns": [ - "wallet_id", - "outpoint" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.wallet_labels": { - "name": "wallet_labels", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "wallet_id": { - "name": "wallet_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wallet_labels_wallet_id_wallet_wallets_id_fk": { - "name": "wallet_labels_wallet_id_wallet_wallets_id_fk", - "tableFrom": "wallet_labels", - "tableTo": "wallet_wallets", - "columnsFrom": [ - "wallet_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_wallet_labels_wallet_kind_ref": { - "name": "uq_wallet_labels_wallet_kind_ref", - "nullsNotDistinct": false, - "columns": [ - "wallet_id", - "kind", - "ref" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.wallet_wallets": { - "name": "wallet_wallets", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network": { - "name": "network", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'bitcoin'" - }, - "config": { - "name": "config", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "seed_envelope": { - "name": "seed_envelope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fingerprint": { - "name": "fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "xpubs": { - "name": "xpubs", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "default_bip": { - "name": "default_bip", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 84 - }, - "is_active": { - "name": "is_active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "uq_wallet_wallets_one_active": { - "name": "uq_wallet_wallets_one_active", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"wallet_wallets\".\"is_active\"", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "wallet_wallets_user_id_users_id_fk": { - "name": "wallet_wallets_user_id_users_id_fk", - "tableFrom": "wallet_wallets", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_wallet_wallets_user_name": { - "name": "uq_wallet_wallets_user_name", - "nullsNotDistinct": false, - "columns": [ - "user_id", - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/src/databases/officer_db/migrations/meta/_journal.json b/src/databases/officer_db/migrations/meta/_journal.json deleted file mode 100644 index 2fb34a3c..00000000 --- a/src/databases/officer_db/migrations/meta/_journal.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "entries": [ - { - "idx": 0, - "version": "7", - "when": 1785771021535, - "tag": "0000_new_princess_powerful", - "breakpoints": true - } - ] -} \ No newline at end of file