openreader/packages/database/migrations/postgres/0004_admin_panel.sql
Richard R 358a56cc9a refactor: implement modular monorepo packages
- Extract database schema and migrations into @openreader/database

- Extract startup and orchestration scripts into @openreader/bootstrap

- Move compute-worker into packages/compute-worker

- Remove runtime dependency on drizzle-kit

- Update Dockerfile to deploy isolated packages without merging node_modules
2026-06-13 13:51:18 -06:00

25 lines
No EOL
918 B
SQL

CREATE TABLE "admin_providers" (
"id" text PRIMARY KEY NOT NULL,
"slug" text NOT NULL,
"display_name" text NOT NULL,
"provider_type" text NOT NULL,
"base_url" text,
"api_key_ciphertext" text NOT NULL,
"api_key_iv" text NOT NULL,
"api_key_last4" text,
"default_model" text,
"default_instructions" text,
"enabled" integer DEFAULT 1 NOT NULL,
"created_at" bigint DEFAULT (extract(epoch from now()) * 1000)::bigint NOT NULL,
"updated_at" bigint DEFAULT (extract(epoch from now()) * 1000)::bigint NOT NULL,
CONSTRAINT "admin_providers_slug_unique" UNIQUE("slug")
);
--> statement-breakpoint
CREATE TABLE "admin_settings" (
"key" text PRIMARY KEY NOT NULL,
"value_json" jsonb NOT NULL,
"source" text DEFAULT 'admin' NOT NULL,
"updated_at" bigint DEFAULT (extract(epoch from now()) * 1000)::bigint NOT NULL
);
--> statement-breakpoint
ALTER TABLE "user" ADD COLUMN "is_admin" boolean DEFAULT false NOT NULL;