summaryrefslogtreecommitdiff
path: root/db/migrations/0009_wet_joseph.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations/0009_wet_joseph.sql')
-rw-r--r--db/migrations/0009_wet_joseph.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrations/0009_wet_joseph.sql b/db/migrations/0009_wet_joseph.sql
new file mode 100644
index 00000000..41789b99
--- /dev/null
+++ b/db/migrations/0009_wet_joseph.sql
@@ -0,0 +1,12 @@
+CREATE TABLE "vendor_types" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "code" varchar(50) NOT NULL,
+ "name_ko" varchar(255) NOT NULL,
+ "name_en" varchar(255) NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL,
+ CONSTRAINT "vendor_types_code_unique" UNIQUE("code")
+);
+--> statement-breakpoint
+ALTER TABLE "vendors" ADD COLUMN "vendor_type_id" integer;--> statement-breakpoint
+ALTER TABLE "vendors" ADD CONSTRAINT "vendors_vendor_type_id_vendor_types_id_fk" FOREIGN KEY ("vendor_type_id") REFERENCES "public"."vendor_types"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file