chore(): Fix database test utils and utils (#6383)

**What**
Fix the test utils database to trully run the migrations, the migration path is deprecated and not used anymore as umzung infer the path under the hood. It also fix the schema so that it is possible to specify different schema if needed.

The index helper can now create named constraints for uniqueness. 

extracted [from](https://github.com/medusajs/medusa/pull/6381)
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2024-02-12 18:07:15 +00:00
1 parent 1593e0b192
commit e85463b2a7
5 files changed
+90 -32

No files matched your search

@@ -23,7 +23,7 @@ export class Migration20240124154000 extends Migration {
'create index if not exists "IDX_customer_address_customer_id" on "customer_address" ("customer_id");'
)
this.addSql(
'create unique index "IDX_customer_address_unqiue_customer_billing" on "customer_address" ("customer_id") where "is_default_billing" = true;'
'create unique index "IDX_customer_address_unique_customer_billing" on "customer_address" ("customer_id") where "is_default_billing" = true;'
)
this.addSql(
'create unique index "IDX_customer_address_unique_customer_shipping" on "customer_address" ("customer_id") where "is_default_shipping" = true;'