fix(stock-location,core-flows,types): updates existing address when updating stock location (#10832)
* fix(stock-location,core-flows,types): updates existing address when updating stock location address * chore: use hasOne instead of hasMany
This commit is contained in:
@@ -227,6 +227,15 @@
|
||||
"name": "stock_location",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"address_id"
|
||||
],
|
||||
"composite": false,
|
||||
"keyName": "stock_location_address_id_unique",
|
||||
"primary": false,
|
||||
"unique": true
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_stock_location_address_id",
|
||||
"columnNames": [],
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
|
||||
export class Migration20250106142624 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "stock_location" add constraint "stock_location_address_id_unique" unique ("address_id");'
|
||||
)
|
||||
}
|
||||
|
||||
async down(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "stock_location" drop constraint if exists "stock_location_address_id_unique";'
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user