feat: Remove fields from payment models that were leftovers from v1 (#10987)
This commit is contained in:
@@ -60,15 +60,6 @@
|
||||
"nullable": true,
|
||||
"mappedType": "decimal"
|
||||
},
|
||||
"region_id": {
|
||||
"name": "region_id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"completed_at": {
|
||||
"name": "completed_at",
|
||||
"type": "timestamptz",
|
||||
@@ -185,14 +176,6 @@
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_payment_collection_deleted_at\" ON \"payment_collection\" (deleted_at) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_payment_collection_region_id",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_payment_collection_region_id\" ON \"payment_collection\" (region_id) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "payment_collection_pkey",
|
||||
"columnNames": [
|
||||
@@ -700,33 +683,6 @@
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"cart_id": {
|
||||
"name": "cart_id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"order_id": {
|
||||
"name": "order_id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"customer_id": {
|
||||
"name": "customer_id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"data": {
|
||||
"name": "data",
|
||||
"type": "jsonb",
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20250115160517 extends Migration {
|
||||
|
||||
async up(): Promise<void> {
|
||||
this.addSql('drop index if exists "IDX_payment_collection_region_id";');
|
||||
this.addSql('alter table if exists "payment_collection" drop column if exists "region_id";');
|
||||
|
||||
this.addSql('alter table if exists "payment" drop column if exists "cart_id";');
|
||||
this.addSql('alter table if exists "payment" drop column if exists "order_id";');
|
||||
this.addSql('alter table if exists "payment" drop column if exists "customer_id";');
|
||||
}
|
||||
|
||||
async down(): Promise<void> {
|
||||
this.addSql('alter table if exists "payment_collection" add column if not exists "region_id" text not null;');
|
||||
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_payment_collection_region_id" ON "payment_collection" (region_id) WHERE deleted_at IS NULL;');
|
||||
|
||||
this.addSql('alter table if exists "payment" add column if not exists "cart_id" text null, add column if not exists "order_id" text null, add column if not exists "customer_id" text null;');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user