Skip to content

Commit

Permalink
chore: scope migrations to only to create if not exist - money amount…
Browse files Browse the repository at this point in the history
…, currency
  • Loading branch information
riqwan committed Oct 10, 2023
1 parent 35572c9 commit d9640c2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 52 deletions.
28 changes: 0 additions & 28 deletions packages/pricing/src/migrations/.snapshot-medusa-pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@
"primary": false,
"nullable": false,
"mappedType": "text"
},
"includes_tax": {
"name": "includes_tax",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "false",
"mappedType": "boolean"
}
},
"name": "currency",
Expand Down Expand Up @@ -115,24 +105,6 @@
"primary": false,
"nullable": true,
"mappedType": "decimal"
},
"price_list_id": {
"name": "price_list_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"region_id": {
"name": "region_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
}
},
"name": "money_amount",
Expand Down
2 changes: 1 addition & 1 deletion packages/pricing/src/migrations/Migration20230929122253.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Migration20230929122253 extends Migration {
'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(
Expand Down
20 changes: 0 additions & 20 deletions packages/pricing/src/migrations/Migration20231010102411.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/pricing/src/models/money-amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class MoneyAmount {
@Property({ columnType: "numeric", nullable: true })
max_quantity?: number | null

@Property({ columnType: "text", nullable: true })
price_list_id?: string

@BeforeCreate()
onCreate() {
this.id = generateEntityId(this.id, "ma")
Expand Down

0 comments on commit d9640c2

Please sign in to comment.