add migration
This commit is contained in:
@@ -348,6 +348,16 @@
|
||||
"name": "field",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "field_entity_id_index",
|
||||
"columnNames": [
|
||||
"entity_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "field_pkey",
|
||||
"columnNames": [
|
||||
@@ -429,6 +439,16 @@
|
||||
"name": "field_option",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "field_option_field_id_index",
|
||||
"columnNames": [
|
||||
"field_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "field_option_pkey",
|
||||
"columnNames": [
|
||||
@@ -1343,6 +1363,16 @@
|
||||
"primary": false,
|
||||
"unique": true
|
||||
},
|
||||
{
|
||||
"keyName": "admins_phone_index",
|
||||
"columnNames": [
|
||||
"phone"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "admins_pkey",
|
||||
"columnNames": [
|
||||
@@ -1397,6 +1427,16 @@
|
||||
"name": "role_permissions",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "role_permissions_role_id_index",
|
||||
"columnNames": [
|
||||
"role_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "role_permissions_pkey",
|
||||
"columnNames": [
|
||||
@@ -1605,6 +1645,16 @@
|
||||
"primary": false,
|
||||
"unique": true
|
||||
},
|
||||
{
|
||||
"keyName": "users_phone_index",
|
||||
"columnNames": [
|
||||
"phone"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "users_pkey",
|
||||
"columnNames": [
|
||||
@@ -1731,6 +1781,16 @@
|
||||
"name": "tickets",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "tickets_user_id_index",
|
||||
"columnNames": [
|
||||
"user_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "tickets_pkey",
|
||||
"columnNames": [
|
||||
@@ -1987,6 +2047,16 @@
|
||||
"name": "request_items",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "request_items_request_id_index",
|
||||
"columnNames": [
|
||||
"request_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "request_items_pkey",
|
||||
"columnNames": [
|
||||
@@ -2123,6 +2193,16 @@
|
||||
"name": "notifications",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "notifications_user_id_index",
|
||||
"columnNames": [
|
||||
"user_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "notifications_pkey",
|
||||
"columnNames": [
|
||||
@@ -2844,6 +2924,16 @@
|
||||
"name": "invoice_items",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "invoice_items_invoice_id_index",
|
||||
"columnNames": [
|
||||
"invoice_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "invoice_items_pkey",
|
||||
"columnNames": [
|
||||
@@ -3075,6 +3165,26 @@
|
||||
"primary": false,
|
||||
"unique": true
|
||||
},
|
||||
{
|
||||
"keyName": "orders_status_index",
|
||||
"columnNames": [
|
||||
"status"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "orders_designer_id_index",
|
||||
"columnNames": [
|
||||
"designer_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "orders_user_id_index",
|
||||
"columnNames": [
|
||||
@@ -3611,6 +3721,16 @@
|
||||
"name": "chat",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "chat_user_id_index",
|
||||
"columnNames": [
|
||||
"user_id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false
|
||||
},
|
||||
{
|
||||
"keyName": "chat_pkey",
|
||||
"columnNames": [
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260409060704 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`create index "field_entity_id_index" on "field" ("entity_id");`);
|
||||
|
||||
this.addSql(`create index "field_option_field_id_index" on "field_option" ("field_id");`);
|
||||
|
||||
this.addSql(`create index "admins_phone_index" on "admins" ("phone");`);
|
||||
|
||||
this.addSql(`create index "role_permissions_role_id_index" on "role_permissions" ("role_id");`);
|
||||
|
||||
this.addSql(`create index "users_phone_index" on "users" ("phone");`);
|
||||
|
||||
this.addSql(`create index "tickets_user_id_index" on "tickets" ("user_id");`);
|
||||
|
||||
this.addSql(`create index "request_items_request_id_index" on "request_items" ("request_id");`);
|
||||
|
||||
this.addSql(`create index "notifications_user_id_index" on "notifications" ("user_id");`);
|
||||
|
||||
this.addSql(`create index "invoice_items_invoice_id_index" on "invoice_items" ("invoice_id");`);
|
||||
|
||||
this.addSql(`create index "orders_status_index" on "orders" ("status");`);
|
||||
this.addSql(`create index "orders_designer_id_index" on "orders" ("designer_id");`);
|
||||
|
||||
this.addSql(`create index "chat_user_id_index" on "chat" ("user_id");`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`drop index "field_entity_id_index";`);
|
||||
|
||||
this.addSql(`drop index "field_option_field_id_index";`);
|
||||
|
||||
this.addSql(`drop index "admins_phone_index";`);
|
||||
|
||||
this.addSql(`drop index "role_permissions_role_id_index";`);
|
||||
|
||||
this.addSql(`drop index "users_phone_index";`);
|
||||
|
||||
this.addSql(`drop index "tickets_user_id_index";`);
|
||||
|
||||
this.addSql(`drop index "request_items_request_id_index";`);
|
||||
|
||||
this.addSql(`drop index "notifications_user_id_index";`);
|
||||
|
||||
this.addSql(`drop index "invoice_items_invoice_id_index";`);
|
||||
|
||||
this.addSql(`drop index "orders_status_index";`);
|
||||
this.addSql(`drop index "orders_designer_id_index";`);
|
||||
|
||||
this.addSql(`drop index "chat_user_id_index";`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user