This repository has been archived on 2026-02-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
serengo/drizzle/0008_common_supreme_intelligence.sql

15 lines
902 B
SQL

CREATE TABLE "location" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"latitude" text NOT NULL,
"longitude" text NOT NULL,
"location_name" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "find" ADD COLUMN "location_id" text NOT NULL;--> statement-breakpoint
ALTER TABLE "location" ADD CONSTRAINT "location_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "find" ADD CONSTRAINT "find_location_id_location_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "find" DROP COLUMN "latitude";--> statement-breakpoint
ALTER TABLE "find" DROP COLUMN "longitude";--> statement-breakpoint
ALTER TABLE "find" DROP COLUMN "location_name";