@sgftech/medusa-plugin-product-variant-licenses 0.0.1 → 0.0.2

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.
package/medusa-config.js CHANGED
@@ -105,18 +105,7 @@ const plugins = [
105
105
  }
106
106
  }
107
107
  },
108
- {
109
- resolve: `@rsc-labs/medusa-store-analytics`,
110
- options: {
111
- enableUI: true
112
- }
113
- },
114
- {
115
- resolve: `@rsc-labs/medusa-documents`,
116
- options: {
117
- enableUI: true
118
- }
119
- }
108
+
120
109
  ];
121
110
 
122
111
  const modules = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sgftech/medusa-plugin-product-variant-licenses",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "A plugin to handle licenses",
5
5
  "author": "SGFGOV",
6
6
  "license": "MIT",
@@ -25,9 +25,7 @@
25
25
  "start:custom": "cross-env npm run build && node --preserve-symlinks --trace-warnings index.js",
26
26
  "dev": "cross-env npm run build:server && medusa develop"
27
27
  },
28
- "dependencies": {
29
-
30
- },
28
+ "dependencies": {},
31
29
  "devDependencies": {
32
30
  "@babel/cli": "^7.14.3",
33
31
  "@babel/core": "^7.14.3",
@@ -0,0 +1,39 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class AlterSkuIndex1717765546069 implements MigrationInterface {
4
+
5
+ identifier = 'AlterSkuIndex1717765546069'
6
+
7
+ public async up(queryRunner: QueryRunner): Promise<void> {
8
+
9
+ const oldIndexName = "IDX_f4dc2c0888b66d547c175f090e"
10
+
11
+ await queryRunner.query(`
12
+ DROP INDEX IF EXISTS ${oldIndexName};
13
+ `);
14
+
15
+ // Create a new unique index with updated fields
16
+ await queryRunner.query(`
17
+ CREATE INDEX ${oldIndexName} ON "product_variant" ("sku", "product_id");
18
+ `);
19
+
20
+ //await queryRunner.query(query)
21
+ //IDX_f4dc2c0888b66d547c175f090e
22
+ }
23
+
24
+ public async down(queryRunner: QueryRunner): Promise<void> {
25
+
26
+ const oldIndexName = "IDX_f4dc2c0888b66d547c175f090e"
27
+
28
+
29
+ await queryRunner.query(`
30
+ DROP INDEX IF EXISTS ${oldIndexName};
31
+ `);
32
+
33
+ // Recreate the original unique index
34
+ await queryRunner.query(`
35
+ CREATE INDEX ${oldIndexName} ON "product_variant" ("sku");
36
+ `);
37
+ }
38
+
39
+ }