mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-03 03:04:57 -05:00
* improvement(code-structure): move db into separate package * make db separate package * remake bun lock * update imports to not maintain two separate ones * fix CI for tests by adding dummy url * vercel build fix attempt * update bun lock * regenerate bun lock * fix mocks * remove db commands from apps/sim package json
28 lines
1.3 KiB
SQL
28 lines
1.3 KiB
SQL
CREATE TABLE "logs" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"workflow_id" text NOT NULL,
|
|
"execution_id" text,
|
|
"level" text NOT NULL,
|
|
"message" text NOT NULL,
|
|
"created_at" timestamp DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "user_environment" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"user_id" text NOT NULL,
|
|
"variables" text NOT NULL,
|
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
CONSTRAINT "user_environment_user_id_unique" UNIQUE("user_id")
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "user_settings" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"user_id" text NOT NULL,
|
|
"is_auto_connect_enabled" boolean DEFAULT true NOT NULL,
|
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
CONSTRAINT "user_settings_user_id_unique" UNIQUE("user_id")
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "logs" ADD CONSTRAINT "logs_workflow_id_workflow_id_fk" FOREIGN KEY ("workflow_id") REFERENCES "public"."workflow"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
ALTER TABLE "user_environment" ADD CONSTRAINT "user_environment_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
ALTER TABLE "user_settings" ADD CONSTRAINT "user_settings_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; |