@lodashventure/medusa-parcel-shipping 0.4.10 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2023,6 +2023,12 @@ const routeModule = {
2023
2023
  };
2024
2024
  const menuItemModule = {
2025
2025
  menuItems: [
2026
+ {
2027
+ label: config$3.label,
2028
+ icon: config$3.icon,
2029
+ path: "/areas",
2030
+ nested: void 0
2031
+ },
2026
2032
  {
2027
2033
  label: config$2.label,
2028
2034
  icon: config$2.icon,
@@ -2040,12 +2046,6 @@ const menuItemModule = {
2040
2046
  icon: config.icon,
2041
2047
  path: "/rates",
2042
2048
  nested: void 0
2043
- },
2044
- {
2045
- label: config$3.label,
2046
- icon: config$3.icon,
2047
- path: "/areas",
2048
- nested: void 0
2049
2049
  }
2050
2050
  ]
2051
2051
  };
@@ -2022,6 +2022,12 @@ const routeModule = {
2022
2022
  };
2023
2023
  const menuItemModule = {
2024
2024
  menuItems: [
2025
+ {
2026
+ label: config$3.label,
2027
+ icon: config$3.icon,
2028
+ path: "/areas",
2029
+ nested: void 0
2030
+ },
2025
2031
  {
2026
2032
  label: config$2.label,
2027
2033
  icon: config$2.icon,
@@ -2039,12 +2045,6 @@ const menuItemModule = {
2039
2045
  icon: config.icon,
2040
2046
  path: "/rates",
2041
2047
  nested: void 0
2042
- },
2043
- {
2044
- label: config$3.label,
2045
- icon: config$3.icon,
2046
- path: "/areas",
2047
- nested: void 0
2048
2048
  }
2049
2049
  ]
2050
2050
  };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20251112000000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ /**
6
+ * Safety migration to realign parcel_shipping_rate schema with model definition.
7
+ * Adds missing columns such as price/currency if a database was provisioned before
8
+ * the initial shipping-rate migration shipped.
9
+ */
10
+ class Migration20251112000000 extends migrations_1.Migration {
11
+ async up() {
12
+ const columnAddStatements = [
13
+ {
14
+ column: "price",
15
+ definition: "double precision NOT NULL DEFAULT 0",
16
+ },
17
+ {
18
+ column: "currency",
19
+ definition: "text NOT NULL DEFAULT 'THB'",
20
+ },
21
+ {
22
+ column: "active",
23
+ definition: "boolean NOT NULL DEFAULT true",
24
+ },
25
+ {
26
+ column: "created_at",
27
+ definition: "timestamptz NOT NULL DEFAULT now()",
28
+ },
29
+ {
30
+ column: "updated_at",
31
+ definition: "timestamptz NOT NULL DEFAULT now()",
32
+ },
33
+ ];
34
+ for (const { column, definition } of columnAddStatements) {
35
+ this.addSql(`
36
+ DO $$
37
+ BEGIN
38
+ IF NOT EXISTS (
39
+ SELECT 1 FROM information_schema.columns
40
+ WHERE table_name = 'parcel_shipping_rate'
41
+ AND column_name = '${column}'
42
+ ) THEN
43
+ ALTER TABLE "parcel_shipping_rate" ADD COLUMN "${column}" ${definition};
44
+ END IF;
45
+ END $$;
46
+ `);
47
+ }
48
+ }
49
+ async down() {
50
+ this.addSql(`
51
+ ALTER TABLE "parcel_shipping_rate"
52
+ DROP COLUMN IF EXISTS "price",
53
+ DROP COLUMN IF EXISTS "currency",
54
+ DROP COLUMN IF EXISTS "active",
55
+ DROP COLUMN IF EXISTS "created_at",
56
+ DROP COLUMN IF EXISTS "updated_at";
57
+ `);
58
+ }
59
+ }
60
+ exports.Migration20251112000000 = Migration20251112000000;
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTExMTIwMDAwMDAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9wYXJjZWwtc2hpcHBpbmcvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MTExMjAwMDAwMC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckU7Ozs7R0FJRztBQUNILE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixNQUFNLG1CQUFtQixHQUFHO1lBQzFCO2dCQUNFLE1BQU0sRUFBRSxPQUFPO2dCQUNmLFVBQVUsRUFBRSxxQ0FBcUM7YUFDbEQ7WUFDRDtnQkFDRSxNQUFNLEVBQUUsVUFBVTtnQkFDbEIsVUFBVSxFQUFFLDZCQUE2QjthQUMxQztZQUNEO2dCQUNFLE1BQU0sRUFBRSxRQUFRO2dCQUNoQixVQUFVLEVBQUUsK0JBQStCO2FBQzVDO1lBQ0Q7Z0JBQ0UsTUFBTSxFQUFFLFlBQVk7Z0JBQ3BCLFVBQVUsRUFBRSxvQ0FBb0M7YUFDakQ7WUFDRDtnQkFDRSxNQUFNLEVBQUUsWUFBWTtnQkFDcEIsVUFBVSxFQUFFLG9DQUFvQzthQUNqRDtTQUNGLENBQUM7UUFFRixLQUFLLE1BQU0sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLElBQUksbUJBQW1CLEVBQUUsQ0FBQztZQUN6RCxJQUFJLENBQUMsTUFBTSxDQUFDOzs7Ozs7aUNBTWUsTUFBTTs7NkRBRXNCLE1BQU0sS0FBSyxVQUFVOzs7T0FHM0UsQ0FBQyxDQUFDO1FBQ0wsQ0FBQztJQUNILENBQUM7SUFFUSxLQUFLLENBQUMsSUFBSTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDOzs7Ozs7O0tBT1gsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztDQUNGO0FBbkRELDBEQW1EQyJ9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodashventure/medusa-parcel-shipping",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "Parcel box selection and Thailand shipping quotes for Medusa.",
5
5
  "author": "LodashVenture",
6
6
  "license": "MIT",