design request module
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260607075148_addRequestDesign extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`create table "design_requests" ("id" char(26) not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "title" varchar(255) not null, "count" int not null default 1, "desc" text null, "expected_date" timestamptz null, "attachments" jsonb not null default '[]', "invoice_id" uuid not null, "paid_at" timestamptz null, "business_id" char(26) not null, constraint "design_requests_pkey" primary key ("id"));`);
|
||||
this.addSql(`create index "design_requests_created_at_index" on "design_requests" ("created_at");`);
|
||||
this.addSql(`create index "design_requests_deleted_at_index" on "design_requests" ("deleted_at");`);
|
||||
this.addSql(`create index "design_requests_business_id_id_index" on "design_requests" (("business_id"->>'id'));`);
|
||||
this.addSql(`create index "design_requests_invoice_id_index" on "design_requests" ("invoice_id");`);
|
||||
|
||||
this.addSql(`alter table "design_requests" add constraint "design_requests_business_id_foreign" foreign key ("business_id") references "business" ("id") on update cascade on delete restrict;`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user