feat(link-modules,modules-sdk,pricing): Medusa App Migrations + Core compatible migrations (#5317)
* chore: remove skipping logic for migrations * chore: medusa app returns migrations to run for modules * chore: added migration for feature compatible * chore: added changelog * chore: create table only if it does not exist * chore: update migration to pluck from registered modules * chore: cleanup * chore: make product an internal service temp * chore: added options and deps to module * chore: added link module options * chore: remove duplicate * chore: added missing column names in core + remove from model * chore: scope migrations to only to create if not exist - money amount, currency --------- Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
co-authored by
Sebastian Rindom
parent
57bd38bb4b
commit
b62af612c7
@@ -3,14 +3,14 @@ import { Migration } from "@mikro-orm/migrations"
|
||||
export class Migration20230929122253 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
this.addSql(
|
||||
'create table "currency" ("code" text not null, "symbol" text not null, "symbol_native" text not null, "name" text not null, constraint "currency_pkey" primary key ("code"));'
|
||||
'create table if not exists "currency" ("code" text not null, "symbol" text not null, "symbol_native" text not null, "name" text not null, constraint "currency_pkey" primary key ("code"));'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
'create table "money_amount" ("id" text not null, "currency_code" text null, "amount" numeric null, "min_quantity" numeric null, "max_quantity" numeric null, constraint "money_amount_pkey" primary key ("id"));'
|
||||
'create table if not exists "money_amount" ("id" text not null, "currency_code" text null, "amount" numeric null, "min_quantity" numeric null, "max_quantity" numeric null, constraint "money_amount_pkey" primary key ("id"));'
|
||||
)
|
||||
this.addSql(
|
||||
'create index "IDX_money_amount_currency_code" on "money_amount" ("currency_code");'
|
||||
'create index if not exists "IDX_money_amount_currency_code" on "money_amount" ("currency_code");'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
|
||||
@@ -13,15 +13,6 @@ class Currency {
|
||||
|
||||
@Property({ columnType: "text" })
|
||||
name: string
|
||||
|
||||
// @Property({ persist: false })
|
||||
// get includes_tax() {
|
||||
// // TODO: This comes from a feature flag
|
||||
// // Figure out how we're handling FF in modules
|
||||
// // For now, returning default as true
|
||||
// // This should also not fall on the hands of the model
|
||||
// return true
|
||||
// }
|
||||
}
|
||||
|
||||
export default Currency
|
||||
|
||||
Reference in New Issue
Block a user