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:
Riqwan Thamir
2025-01-07 07:55:28 +01:00
committed by GitHub
parent fde73dbfae
commit 99a06102a2
10 changed files with 336 additions and 7 deletions
@@ -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";'
)
}
}