feat: db init

This commit is contained in:
afiqzudinhadi 2025-06-28 17:21:09 +08:00
parent 0b1cbef59e
commit a6fc74e851
23 changed files with 1536 additions and 5553 deletions

View file

@ -0,0 +1,21 @@
CREATE TABLE "products" (
"id" serial PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"description" text,
"price" numeric(10, 2) NOT NULL,
"image_url" text,
"is_published" boolean DEFAULT false,
"updated_at" timestamp with time zone NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone
);
--> statement-breakpoint
CREATE TABLE "users" (
"id" text PRIMARY KEY NOT NULL,
"email" text NOT NULL,
"name" text,
"role" text DEFAULT 'user' NOT NULL,
"updated_at" timestamp with time zone NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone
);