feat(database): run migration
This commit is contained in:
21
packages/database/drizzle/0000_tan_justin_hammer.sql
Normal file
21
packages/database/drizzle/0000_tan_justin_hammer.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
CREATE TABLE "accounts" (
|
||||
"player_id" uuid PRIMARY KEY NOT NULL,
|
||||
"balance" integer DEFAULT 0 NOT NULL,
|
||||
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "tracked_players" (
|
||||
"player_id" uuid PRIMARY KEY NOT NULL,
|
||||
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "username_history" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"player_id" uuid NOT NULL,
|
||||
"username" text NOT NULL,
|
||||
"first_seen_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "username_history" ADD CONSTRAINT "username_history_player_id_tracked_players_player_id_fk" FOREIGN KEY ("player_id") REFERENCES "public"."tracked_players"("player_id") ON DELETE cascade ON UPDATE no action;
|
||||
Reference in New Issue
Block a user