barname
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260307072601 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`create table "barname" ("id" uuid not null, "created_at" timestamptz not null default current_timestamp, "updated_at" timestamptz not null default current_timestamp, "deleted_at" timestamptz null, "business_id" uuid not null, "company_id" uuid not null, "number" serial, "driver_name" varchar(255) not null, "driver_phone" varchar(255) not null, "origin" varchar(255) not null, "weight" varchar(255) not null, "car_type" varchar(255) not null, "plaque" varchar(255) not null, "description" varchar(255) not null, "attachments" jsonb not null, "exit_at" timestamptz null, "status" varchar(255) not null, constraint "barname_pkey" primary key ("id"));`);
|
||||
|
||||
this.addSql(`alter table "barname" add constraint "barname_business_id_foreign" foreign key ("business_id") references "business" ("id") on update cascade on delete cascade;`);
|
||||
this.addSql(`alter table "barname" add constraint "barname_company_id_foreign" foreign key ("company_id") references "company" ("id") on update cascade on delete cascade;`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user