diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-06-22 13:07:02 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-06-22 13:07:02 +0200 |
| commit | be970248686c0af7d8506cba8c64bf507419da3d (patch) | |
| tree | 3fd8a716b7adae452f1be6dcdd946533da47ad8a /apps/web/migrations/0000_hot_the_fallen.sql | |
| parent | f2d27e578e6214598d36779f44fb1612764c7b3b (diff) | |
| download | opencut-be970248686c0af7d8506cba8c64bf507419da3d.tar.gz | |
so much stuff???
Diffstat (limited to 'apps/web/migrations/0000_hot_the_fallen.sql')
| -rw-r--r-- | apps/web/migrations/0000_hot_the_fallen.sql | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/apps/web/migrations/0000_hot_the_fallen.sql b/apps/web/migrations/0000_hot_the_fallen.sql new file mode 100644 index 00000000..321043f0 --- /dev/null +++ b/apps/web/migrations/0000_hot_the_fallen.sql @@ -0,0 +1,54 @@ +CREATE TABLE "accounts" ( + "id" text PRIMARY KEY NOT NULL, + "account_id" text NOT NULL, + "provider_id" text NOT NULL, + "user_id" text NOT NULL, + "access_token" text, + "refresh_token" text, + "id_token" text, + "access_token_expires_at" timestamp, + "refresh_token_expires_at" timestamp, + "scope" text, + "password" text, + "created_at" timestamp NOT NULL, + "updated_at" timestamp NOT NULL +); +--> statement-breakpoint +ALTER TABLE "accounts" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE "sessions" ( + "id" text PRIMARY KEY NOT NULL, + "expires_at" timestamp NOT NULL, + "token" text NOT NULL, + "created_at" timestamp NOT NULL, + "updated_at" timestamp NOT NULL, + "ip_address" text, + "user_agent" text, + "user_id" text NOT NULL, + CONSTRAINT "sessions_token_unique" UNIQUE("token") +); +--> statement-breakpoint +ALTER TABLE "sessions" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE "users" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "email" text NOT NULL, + "email_verified" boolean NOT NULL, + "image" text, + "created_at" timestamp NOT NULL, + "updated_at" timestamp NOT NULL, + CONSTRAINT "users_email_unique" UNIQUE("email") +); +--> statement-breakpoint +ALTER TABLE "users" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE "verifications" ( + "id" text PRIMARY KEY NOT NULL, + "identifier" text NOT NULL, + "value" text NOT NULL, + "expires_at" timestamp NOT NULL, + "created_at" timestamp, + "updated_at" timestamp +); +--> statement-breakpoint +ALTER TABLE "verifications" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file |
