drop the unapplied migration history
The seven files in officer_db/migrations/ were never applied — this database has only ever been managed with db:push, so there is no __drizzle_migrations table and the numbered history had drifted from the real schema (0001 creates a saved_sessions table the database does not have). Deleted so there is one story about how the schema gets applied. db:gen can write a fresh baseline from the current schema. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0e71d87f75
commit
10400310c5
@@ -83,9 +83,13 @@ where terminals, chats and task runs actually execute).
|
||||
|
||||
### Schema changes use `push`, not migrations
|
||||
|
||||
This database is kept in sync with `bun db:push`. **`drizzle-kit migrate` has never been run here**
|
||||
— there is no `__drizzle_migrations` table, and the files in `officer_db/migrations/` are historical
|
||||
residue that does not describe the live database. Change the schema, run `bun db:push`, done.
|
||||
This database is kept in sync with `bun db:push`, which diffs the schema code against the live
|
||||
database and alters it directly. **`drizzle-kit migrate` has never been run here** — there is no
|
||||
`__drizzle_migrations` table. Change the schema, run `bun db:push`, done.
|
||||
|
||||
`bun db:gen` writes files to `officer_db/migrations/`, but nothing applies them; the old numbered
|
||||
history was deleted because it had drifted from the real schema. Treat the schema code, not those
|
||||
files, as the source of truth.
|
||||
|
||||
## Security Model
|
||||
|
||||
|
||||
@@ -1,366 +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,
|
||||
"role" text DEFAULT 'Member' NOT NULL,
|
||||
"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 "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")
|
||||
);
|
||||
--> 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 "chat_groups" (
|
||||
"slug" text PRIMARY KEY NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"description" text,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "chat_messages" (
|
||||
"id" text PRIMARY KEY NOT NULL,
|
||||
"session_id" text NOT NULL,
|
||||
"role" text NOT NULL,
|
||||
"text" text,
|
||||
"model" text,
|
||||
"tool_name" text,
|
||||
"tool_input" jsonb,
|
||||
"tool_call_id" text,
|
||||
"output" text,
|
||||
"is_error" boolean DEFAULT false,
|
||||
"cost_input_tokens" integer,
|
||||
"cost_output_tokens" integer,
|
||||
"cost_total_usd" numeric(12, 6),
|
||||
"sort_order" integer NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "chat_sessions" (
|
||||
"id" text PRIMARY KEY NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"context" text DEFAULT 'chat' NOT NULL,
|
||||
"context_id" text,
|
||||
"title" text DEFAULT 'New Chat' NOT NULL,
|
||||
"model" text,
|
||||
"cwd" text,
|
||||
"thinking" text,
|
||||
"archived" boolean DEFAULT false NOT NULL,
|
||||
"group_slug" text,
|
||||
"message_count" integer DEFAULT 0 NOT NULL,
|
||||
"cost_input_tokens" integer DEFAULT 0 NOT NULL,
|
||||
"cost_output_tokens" integer DEFAULT 0 NOT NULL,
|
||||
"cost_total_usd" numeric(12, 6) DEFAULT '0' NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_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 "projects" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"slug" text NOT NULL,
|
||||
"meta" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
"layout" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
||||
"terminals" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
||||
"host_terminals" 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_projects_user_slug" UNIQUE("user_id","slug")
|
||||
);
|
||||
--> 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 "extensions" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"scope" text NOT NULL,
|
||||
"user_id" integer,
|
||||
"dir_name" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"implementation" text,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_extensions_scope_user_dir" UNIQUE("scope","user_id","dir_name")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "item_chats" (
|
||||
"id" text PRIMARY KEY NOT NULL,
|
||||
"item_type" text NOT NULL,
|
||||
"item_id" integer NOT NULL,
|
||||
"messages" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_item_chats_type_item" UNIQUE("item_type","item_id")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "processes" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"scope" text NOT NULL,
|
||||
"user_id" integer,
|
||||
"dir_name" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"description" text,
|
||||
"body" text,
|
||||
"version" integer DEFAULT 1 NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_processes_scope_user_dir" UNIQUE("scope","user_id","dir_name")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "skills" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"scope" text NOT NULL,
|
||||
"user_id" integer,
|
||||
"dir_name" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"description" text,
|
||||
"body" text,
|
||||
"version" integer DEFAULT 1 NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_skills_scope_user_dir" UNIQUE("scope","user_id","dir_name")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "tasks" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"scope" text NOT NULL,
|
||||
"user_id" integer,
|
||||
"dir_name" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"description" text,
|
||||
"body" text,
|
||||
"version" integer DEFAULT 1 NOT NULL,
|
||||
"tags" jsonb,
|
||||
"tools" jsonb,
|
||||
"skills" jsonb,
|
||||
"inputs" jsonb,
|
||||
"outputs" jsonb,
|
||||
"dependencies" jsonb,
|
||||
"config" jsonb,
|
||||
"trigger" jsonb,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_tasks_scope_user_dir" UNIQUE("scope","user_id","dir_name")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "tools" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"scope" text NOT NULL,
|
||||
"user_id" integer,
|
||||
"dir_name" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"label" text,
|
||||
"description" text,
|
||||
"body" text,
|
||||
"version" integer DEFAULT 1 NOT NULL,
|
||||
"language" text,
|
||||
"inputs" jsonb,
|
||||
"implementation" text,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "uq_tools_scope_user_dir" UNIQUE("scope","user_id","dir_name")
|
||||
);
|
||||
--> 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 "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")
|
||||
);
|
||||
--> 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
|
||||
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 "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 "chat_groups" ADD CONSTRAINT "chat_groups_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "chat_messages" ADD CONSTRAINT "chat_messages_session_id_chat_sessions_id_fk" FOREIGN KEY ("session_id") REFERENCES "public"."chat_sessions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "chat_sessions" ADD CONSTRAINT "chat_sessions_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 "projects" ADD CONSTRAINT "projects_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 "extensions" ADD CONSTRAINT "extensions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "processes" ADD CONSTRAINT "processes_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "skills" ADD CONSTRAINT "skills_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "tasks" ADD CONSTRAINT "tasks_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "tools" ADD CONSTRAINT "tools_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 "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
|
||||
CREATE INDEX "idx_token_blacklist_expires" ON "token_blacklist" USING btree ("expires_at");--> statement-breakpoint
|
||||
CREATE INDEX "idx_chat_groups_user" ON "chat_groups" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_messages_session_order" ON "chat_messages" USING btree ("session_id","sort_order");--> statement-breakpoint
|
||||
CREATE INDEX "idx_sessions_user_context" ON "chat_sessions" USING btree ("user_id","context");--> statement-breakpoint
|
||||
CREATE INDEX "idx_sessions_user_created" ON "chat_sessions" USING btree ("user_id","created_at");--> statement-breakpoint
|
||||
CREATE INDEX "idx_sessions_user_group" ON "chat_sessions" USING btree ("user_id","group_slug");--> statement-breakpoint
|
||||
CREATE INDEX "idx_extensions_scope" ON "extensions" USING btree ("scope");--> statement-breakpoint
|
||||
CREATE INDEX "idx_extensions_user" ON "extensions" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_item_chats_type_item" ON "item_chats" USING btree ("item_type","item_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_processes_scope" ON "processes" USING btree ("scope");--> statement-breakpoint
|
||||
CREATE INDEX "idx_processes_user" ON "processes" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_skills_scope" ON "skills" USING btree ("scope");--> statement-breakpoint
|
||||
CREATE INDEX "idx_skills_user" ON "skills" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_tasks_scope" ON "tasks" USING btree ("scope");--> statement-breakpoint
|
||||
CREATE INDEX "idx_tasks_user" ON "tasks" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "idx_tools_scope" ON "tools" USING btree ("scope");--> statement-breakpoint
|
||||
CREATE INDEX "idx_tools_user" ON "tools" 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");
|
||||
@@ -1,19 +0,0 @@
|
||||
CREATE TABLE "saved_sessions" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"provider" text NOT NULL,
|
||||
"context" text,
|
||||
"context_id" text,
|
||||
"title" text NOT NULL,
|
||||
"summary" text NOT NULL,
|
||||
"raw_messages" jsonb NOT NULL,
|
||||
"cwd" text NOT NULL,
|
||||
"cost" jsonb NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
DROP TABLE "chat_groups" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "chat_messages" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "chat_sessions" CASCADE;--> statement-breakpoint
|
||||
ALTER TABLE "saved_sessions" ADD CONSTRAINT "saved_sessions_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_saved_sessions_user_created" ON "saved_sessions" USING btree ("user_id","created_at");
|
||||
@@ -1,4 +0,0 @@
|
||||
ALTER TABLE "tasks" ADD COLUMN "mode" text DEFAULT 'agentic' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "tasks" ADD COLUMN "language" text;--> statement-breakpoint
|
||||
ALTER TABLE "tasks" ADD COLUMN "implementation" text;--> statement-breakpoint
|
||||
ALTER TABLE "tasks" ADD COLUMN "args" jsonb;
|
||||
@@ -1,20 +0,0 @@
|
||||
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,
|
||||
"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,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"started_at" timestamp with time zone,
|
||||
"completed_at" timestamp with time zone
|
||||
);
|
||||
--> 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
|
||||
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");
|
||||
@@ -1,6 +0,0 @@
|
||||
DROP TABLE "extensions" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "item_chats" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "processes" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "skills" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "tasks" CASCADE;--> statement-breakpoint
|
||||
DROP TABLE "tools" CASCADE;
|
||||
@@ -1,2 +0,0 @@
|
||||
ALTER TABLE "pipeline_jobs" ADD COLUMN "mode" text DEFAULT 'pipeline' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "pipeline_jobs" ADD COLUMN "exit_code" integer;
|
||||
@@ -1 +0,0 @@
|
||||
ALTER TABLE "users" DROP COLUMN "role";
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
{
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"entries": [
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "7",
|
||||
"when": 1772795711164,
|
||||
"tag": "0000_futuristic_ink",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "7",
|
||||
"when": 1772799835768,
|
||||
"tag": "0001_freezing_carmella_unuscione",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "7",
|
||||
"when": 1772985087180,
|
||||
"tag": "0002_cute_doorman",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "7",
|
||||
"when": 1773040399200,
|
||||
"tag": "0003_perpetual_james_howlett",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "7",
|
||||
"when": 1784593790333,
|
||||
"tag": "0004_true_annihilus",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "7",
|
||||
"when": 1784813792772,
|
||||
"tag": "0005_small_the_phantom",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 6,
|
||||
"version": "7",
|
||||
"when": 1785013713432,
|
||||
"tag": "0006_absurd_dormammu",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user