add: migration
This commit is contained in:
@@ -239,6 +239,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -441,6 +450,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -691,6 +709,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -919,6 +946,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -1148,6 +1184,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -1375,6 +1420,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -1556,6 +1610,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -1805,6 +1868,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -2033,6 +2105,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -2357,6 +2438,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -2566,6 +2656,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -2818,6 +2917,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -3077,6 +3185,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -3276,6 +3393,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -3710,6 +3836,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -4037,6 +4172,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -4279,6 +4423,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -4478,6 +4631,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -4842,6 +5004,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -5144,6 +5315,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -5385,6 +5565,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -5594,6 +5783,279 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"active",
|
||||
"closed",
|
||||
"archived"
|
||||
]
|
||||
},
|
||||
"message_type": {
|
||||
"name": "message_type",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"user",
|
||||
"bot",
|
||||
"system"
|
||||
]
|
||||
},
|
||||
"message_status": {
|
||||
"name": "message_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"sent",
|
||||
"delivered",
|
||||
"read",
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "uuid",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "uuid"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"length": 6,
|
||||
"default": "current_timestamp",
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"length": 6,
|
||||
"default": "current_timestamp",
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"deleted_at": {
|
||||
"name": "deleted_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"length": 6,
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"reject_reason": {
|
||||
"name": "reject_reason",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"request_status": {
|
||||
"name": "request_status",
|
||||
"type": "company_request_status",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"nativeEnumName": "company_request_status",
|
||||
"default": "'PENDING'",
|
||||
"enumItems": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
],
|
||||
"mappedType": "enum"
|
||||
},
|
||||
"company_id": {
|
||||
"name": "company_id",
|
||||
"type": "uuid",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "uuid"
|
||||
},
|
||||
"business_id": {
|
||||
"name": "business_id",
|
||||
"type": "uuid",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "uuid"
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "uuid",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "uuid"
|
||||
}
|
||||
},
|
||||
"name": "company_request",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "company_request_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
}
|
||||
],
|
||||
"checks": [],
|
||||
"foreignKeys": {
|
||||
"company_request_company_id_foreign": {
|
||||
"constraintName": "company_request_company_id_foreign",
|
||||
"columnNames": [
|
||||
"company_id"
|
||||
],
|
||||
"localTableName": "public.company_request",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedTableName": "public.company",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"company_request_business_id_foreign": {
|
||||
"constraintName": "company_request_business_id_foreign",
|
||||
"columnNames": [
|
||||
"business_id"
|
||||
],
|
||||
"localTableName": "public.company_request",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedTableName": "public.business",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"company_request_user_id_foreign": {
|
||||
"constraintName": "company_request_user_id_foreign",
|
||||
"columnNames": [
|
||||
"user_id"
|
||||
],
|
||||
"localTableName": "public.company_request",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedTableName": "public.user",
|
||||
"updateRule": "cascade"
|
||||
}
|
||||
},
|
||||
"nativeEnums": {
|
||||
"role_enum": {
|
||||
"name": "role_enum",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"ADMIN",
|
||||
"USER"
|
||||
]
|
||||
},
|
||||
"notif_type": {
|
||||
"name": "notif_type",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"OTP",
|
||||
"USER_LOGIN",
|
||||
"ANNOUNCEMENT",
|
||||
"WALLET_CHARGE",
|
||||
"WALLET_DEDUCTION",
|
||||
"BILL_INVOICE_REMINDER",
|
||||
"BILL_INVOICE",
|
||||
"APPROVE_INVOICE",
|
||||
"CREATE_INVOICE",
|
||||
"INVOICE_OVERDUE",
|
||||
"CREATE_SERVICE",
|
||||
"UNBLOCK_SERVICE",
|
||||
"BLOCK_SERVICE",
|
||||
"ANSWER_TICKET",
|
||||
"CREATE_TICKET",
|
||||
"ASSIGN_TICKET",
|
||||
"RECURRING_INVOICE",
|
||||
"PAYMENT_REMINDER",
|
||||
"PAYMENT_CANCELLATION",
|
||||
"NEW_CUSTOMER",
|
||||
"NEW_TICKET",
|
||||
"NEW_CRITICISM"
|
||||
]
|
||||
},
|
||||
"company_status": {
|
||||
"name": "company_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"APPROVED",
|
||||
"PENDING",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"ticket_status": {
|
||||
"name": "ticket_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"ANSWERED",
|
||||
"CLOSED"
|
||||
]
|
||||
},
|
||||
"ticket_priority": {
|
||||
"name": "ticket_priority",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"LOW",
|
||||
"MEDIUM",
|
||||
"HIGH"
|
||||
]
|
||||
},
|
||||
"invoice_status": {
|
||||
"name": "invoice_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"DRAFT",
|
||||
"PENDING",
|
||||
"WAIT_PAYMENT",
|
||||
"PAID",
|
||||
"ARCHIVED",
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -5803,6 +6265,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -6036,6 +6507,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -6316,6 +6796,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -6537,6 +7026,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
@@ -6644,6 +7142,15 @@
|
||||
"OVERDUE"
|
||||
]
|
||||
},
|
||||
"company_request_status": {
|
||||
"name": "company_request_status",
|
||||
"schema": "public",
|
||||
"items": [
|
||||
"PENDING",
|
||||
"APPROVED",
|
||||
"REJECTED"
|
||||
]
|
||||
},
|
||||
"chat_session_status": {
|
||||
"name": "chat_session_status",
|
||||
"schema": "public",
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260217121029_meterageREquired extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`select 1`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`select 1`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Migration } from "@mikro-orm/migrations";
|
||||
|
||||
export class Migration20260217122512_meterageREquired extends Migration {
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`alter table "company" alter column "metrage" type int using ("metrage"::int);`);
|
||||
this.addSql(`update "company" set "metrage" = 0 where "metrage" is null;`);
|
||||
this.addSql(`alter table "company" alter column "metrage" set not null;`);
|
||||
|
||||
this.addSql(`alter table "invoice" alter column "total_price" type numeric using ("total_price"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "original_price" type numeric using ("original_price"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "tax" type numeric using ("tax"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "late_fee" type numeric using ("late_fee"::numeric);`);
|
||||
|
||||
this.addSql(`alter table "payment" alter column "amount" type numeric using ("amount"::numeric);`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`alter table "company" alter column "metrage" type int4 using ("metrage"::int4);`);
|
||||
this.addSql(`alter table "company" alter column "metrage" drop not null;`);
|
||||
|
||||
this.addSql(`alter table "invoice" alter column "total_price" type numeric using ("total_price"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "original_price" type numeric using ("original_price"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "tax" type numeric using ("tax"::numeric);`);
|
||||
this.addSql(`alter table "invoice" alter column "late_fee" type numeric using ("late_fee"::numeric);`);
|
||||
|
||||
this.addSql(`alter table "payment" alter column "amount" type numeric using ("amount"::numeric);`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user