nodes/store/drizzle/0001_damp_captain_midlands.sql
Max Richter c6badff1ee
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 36s
fix: dockerfile
2024-12-20 12:36:11 +01:00

14 lines
1.1 KiB
SQL

ALTER TABLE "nodes" ADD PRIMARY KEY ("id");--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "id" SET DATA TYPE uuid;--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "id" SET DEFAULT gen_random_uuid();--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "name" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "userId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "systemId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "nodeId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "hash" varchar(8) NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "previous" integer;--> statement-breakpoint
CREATE INDEX "user_id_idx" ON "nodes" USING btree ("userId");--> statement-breakpoint
CREATE INDEX "system_id_idx" ON "nodes" USING btree ("systemId");--> statement-breakpoint
CREATE INDEX "node_id_idx" ON "nodes" USING btree ("nodeId");--> statement-breakpoint
CREATE INDEX "hash_idx" ON "nodes" USING btree ("hash");--> statement-breakpoint
ALTER TABLE "users" ADD CONSTRAINT "users_name_unique" UNIQUE("name");