@reachu/database 1.0.74 → 1.0.76
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/dist/entity/ExternalRequest.d.ts +1 -1
- package/dist/entity/ExternalRequest.js +3 -3
- package/dist/entity/ExternalRequest.js.map +1 -1
- package/dist/entity/ShopifyConnection.js +6 -4
- package/dist/entity/ShopifyConnection.js.map +1 -1
- package/dist/migrations/1684975416295-shopify-conn-2.d.ts +6 -0
- package/dist/migrations/1684975416295-shopify-conn-2.js +31 -0
- package/dist/migrations/1684975416295-shopify-conn-2.js.map +1 -0
- package/dist/migrations/1685128263295-external-request-update.d.ts +6 -0
- package/dist/migrations/1685128263295-external-request-update.js +45 -0
- package/dist/migrations/1685128263295-external-request-update.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +27 -3
- package/package.json +3 -3
- package/src/entity/ExternalRequest.ts +5 -5
- package/src/entity/ShopifyConnection.ts +6 -3
- package/src/migrations/1684975416295-shopify-conn-2.ts +16 -0
- package/src/migrations/1685128263295-external-request-update.ts +30 -0
|
@@ -37,9 +37,9 @@ __decorate([
|
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], ExternalRequest.prototype, "receiverEmail", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
typeorm_1.Column('
|
|
41
|
-
__metadata("design:type",
|
|
42
|
-
], ExternalRequest.prototype, "
|
|
40
|
+
typeorm_1.Column('varchar', { nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ExternalRequest.prototype, "collectionIds", void 0);
|
|
43
43
|
__decorate([
|
|
44
44
|
typeorm_1.Column('varchar'),
|
|
45
45
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalRequest.js","sourceRoot":"","sources":["../../src/entity/ExternalRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kEAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"ExternalRequest.js","sourceRoot":"","sources":["../../src/entity/ExternalRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kEAA0C;AAC1C,wEAAgD;AAChD,kDAA0B;AAG1B,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;CA0BxD,CAAA;AAxBC;IADC,gCAAsB,EAAE;;2CACd;AAIX;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,oBAAU,EAAE;8BACL,cAAI;+CAAC;AAIb;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,oBAAU,EAAE;8BACP,cAAI;6CAAC;AAGX;IADC,gBAAM,CAAC,SAAS,CAAC;;sDACI;AAGtB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAChB;AAGtB;IADC,gBAAM,CAAC,SAAS,CAAC;;4CACN;AAMZ;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACpC;AAzBK,eAAe;IADnC,gBAAM,EAAE;GACY,eAAe,CA0BnC;kBA1BoB,eAAe"}
|
|
@@ -30,12 +30,12 @@ __decorate([
|
|
|
30
30
|
__metadata("design:type", Boolean)
|
|
31
31
|
], ShopifyConnection.prototype, "importedProducts", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifyReseller, { onDelete: 'CASCADE' }),
|
|
34
|
-
typeorm_1.JoinColumn(),
|
|
33
|
+
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifyReseller, { onDelete: 'CASCADE', nullable: true }),
|
|
34
|
+
typeorm_1.JoinColumn({}),
|
|
35
35
|
__metadata("design:type", User_1.default)
|
|
36
36
|
], ShopifyConnection.prototype, "reseller", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifySupplier, { onDelete: 'CASCADE' }),
|
|
38
|
+
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifySupplier, { onDelete: 'CASCADE', nullable: true }),
|
|
39
39
|
typeorm_1.JoinColumn(),
|
|
40
40
|
__metadata("design:type", User_1.default)
|
|
41
41
|
], ShopifyConnection.prototype, "supplier", void 0);
|
|
@@ -64,7 +64,9 @@ __decorate([
|
|
|
64
64
|
__metadata("design:type", String)
|
|
65
65
|
], ShopifyConnection.prototype, "locationId", void 0);
|
|
66
66
|
ShopifyConnection = __decorate([
|
|
67
|
-
typeorm_1.Entity()
|
|
67
|
+
typeorm_1.Entity(),
|
|
68
|
+
typeorm_1.Unique(['supplier', 'deletedAt']),
|
|
69
|
+
typeorm_1.Unique(['reseller', 'deletedAt'])
|
|
68
70
|
], ShopifyConnection);
|
|
69
71
|
exports.default = ShopifyConnection;
|
|
70
72
|
//# sourceMappingURL=ShopifyConnection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShopifyConnection.js","sourceRoot":"","sources":["../../src/entity/ShopifyConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ShopifyConnection.js","sourceRoot":"","sources":["../../src/entity/ShopifyConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,kDAA0B;AAC1B,kEAA0C;AAK1C,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,sBAAY;CAmC1D,CAAA;AAjCC;IADC,gCAAsB,EAAE;;6CACd;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;oDAAC;AAGhB;IADC,gBAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;2DAClB;AAI1B;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7F,oBAAU,CAAC,EAAE,CAAC;8BACL,cAAI;mDAAC;AAIf;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7F,oBAAU,EAAE;8BACH,cAAI;mDAAC;AAGf;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAClB;AAGpB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC1B;AAGZ;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACpB;AAGlB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACnB;AAGnB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACf;AAGvB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAClB;AAlCD,iBAAiB;IAHrC,gBAAM,EAAE;IACR,gBAAM,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IACjC,gBAAM,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;GACb,iBAAiB,CAmCrC;kBAnCoB,iBAAiB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.shopifyConn21684975416295 = void 0;
|
|
13
|
+
class shopifyConn21684975416295 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'shopifyConn21684975416295';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\` (\`reseller_id\`, \`deleted_at\`)`);
|
|
20
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\` (\`supplier_id\`, \`deleted_at\`)`);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
down(queryRunner) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield queryRunner.query(`DROP INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\``);
|
|
26
|
+
yield queryRunner.query(`DROP INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\``);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.shopifyConn21684975416295 = shopifyConn21684975416295;
|
|
31
|
+
//# sourceMappingURL=1684975416295-shopify-conn-2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1684975416295-shopify-conn-2.js","sourceRoot":"","sources":["../../src/migrations/1684975416295-shopify-conn-2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,yBAAyB;IAAtC;QACI,SAAI,GAAG,2BAA2B,CAAA;IAYtC,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,oHAAoH,CAAC,CAAC;YAC9I,MAAM,WAAW,CAAC,KAAK,CAAC,oHAAoH,CAAC,CAAC;QAClJ,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;QACvG,CAAC;KAAA;CAEJ;AAbD,8DAaC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.externalRequestUpdate1685128263295 = void 0;
|
|
13
|
+
class externalRequestUpdate1685128263295 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'externalRequestUpdate1685128263295';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`DROP INDEX \`IDX_9499974cf522429803e172a627\` ON \`shopify_connection\``);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD UNIQUE INDEX \`IDX_9499974cf522429803e172a627\` (\`reseller_id\`)`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD UNIQUE INDEX \`IDX_98158a497be5c13a12fad50554\` (\`supplier_id\`)`);
|
|
22
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\` (\`reseller_id\`, \`deleted_at\`)`);
|
|
23
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\` (\`supplier_id\`, \`deleted_at\`)`);
|
|
24
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_9499974cf522429803e172a627\` ON \`shopify_connection\` (\`reseller_id\`)`);
|
|
25
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_98158a497be5c13a12fad50554\` ON \`shopify_connection\` (\`supplier_id\`)`);
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_98158a497be5c13a12fad50554a\` FOREIGN KEY (\`supplier_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
down(queryRunner) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_98158a497be5c13a12fad50554a\``);
|
|
33
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
|
|
34
|
+
yield queryRunner.query(`DROP INDEX \`REL_98158a497be5c13a12fad50554\` ON \`shopify_connection\``);
|
|
35
|
+
yield queryRunner.query(`DROP INDEX \`REL_9499974cf522429803e172a627\` ON \`shopify_connection\``);
|
|
36
|
+
yield queryRunner.query(`DROP INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\``);
|
|
37
|
+
yield queryRunner.query(`DROP INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\``);
|
|
38
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP INDEX \`IDX_98158a497be5c13a12fad50554\``);
|
|
39
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP INDEX \`IDX_9499974cf522429803e172a627\``);
|
|
40
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_9499974cf522429803e172a627\` ON \`shopify_connection\` (\`reseller_id\`)`);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.externalRequestUpdate1685128263295 = externalRequestUpdate1685128263295;
|
|
45
|
+
//# sourceMappingURL=1685128263295-external-request-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1685128263295-external-request-update.js","sourceRoot":"","sources":["../../src/migrations/1685128263295-external-request-update.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,kCAAkC;IAA/C;QACI,SAAI,GAAG,oCAAoC,CAAA;IA0B/C,CAAC;IAxBgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,0GAA0G,CAAC,CAAC;YACpI,MAAM,WAAW,CAAC,KAAK,CAAC,0GAA0G,CAAC,CAAC;YACpI,MAAM,WAAW,CAAC,KAAK,CAAC,oHAAoH,CAAC,CAAC;YAC9I,MAAM,WAAW,CAAC,KAAK,CAAC,oHAAoH,CAAC,CAAC;YAC9I,MAAM,WAAW,CAAC,KAAK,CAAC,oGAAoG,CAAC,CAAC;YAC9H,MAAM,WAAW,CAAC,KAAK,CAAC,oGAAoG,CAAC,CAAC;YAC9H,MAAM,WAAW,CAAC,KAAK,CAAC,sLAAsL,CAAC,CAAC;YAChN,MAAM,WAAW,CAAC,KAAK,CAAC,sLAAsL,CAAC,CAAC;QACpN,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;YAClH,MAAM,WAAW,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;YAClH,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,oGAAoG,CAAC,CAAC;QAClI,CAAC;KAAA;CAEJ;AA3BD,gFA2BC"}
|
|
@@ -1997,7 +1997,7 @@
|
|
|
1997
1997
|
"affectsGlobalScope": false
|
|
1998
1998
|
},
|
|
1999
1999
|
"../src/entity/shopifyconnection.ts": {
|
|
2000
|
-
"version": "
|
|
2000
|
+
"version": "4b7e50bbff5b7c8c0b482fb445c95fb4f7834112d8c7bf5dc9b7bbc21435cfe0",
|
|
2001
2001
|
"signature": "deaaa620213450b2c981971e6fa519cb8e39ada9d97973a431bc95bcb877e4ea",
|
|
2002
2002
|
"affectsGlobalScope": false
|
|
2003
2003
|
},
|
|
@@ -2617,8 +2617,8 @@
|
|
|
2617
2617
|
"affectsGlobalScope": false
|
|
2618
2618
|
},
|
|
2619
2619
|
"../src/entity/externalrequest.ts": {
|
|
2620
|
-
"version": "
|
|
2621
|
-
"signature": "
|
|
2620
|
+
"version": "e3dbe2c420a622b5abfe6ad247f9cbc7553a34265ea2ab94eafc161ecf7774aa",
|
|
2621
|
+
"signature": "0202c7298057e5574e890bf5fba91ac3a7e3b6d774ddb2acb1cd43fe7c8ab79f",
|
|
2622
2622
|
"affectsGlobalScope": false
|
|
2623
2623
|
},
|
|
2624
2624
|
"../src/entity/wallet.ts": {
|
|
@@ -3261,6 +3261,16 @@
|
|
|
3261
3261
|
"signature": "e3453ab701762ed7a0c7f0a2d7f4e915eb5ab7b7dddee752071a2d6268698d86",
|
|
3262
3262
|
"affectsGlobalScope": false
|
|
3263
3263
|
},
|
|
3264
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": {
|
|
3265
|
+
"version": "a5b2486b18841ca237fc7477488dfb28de7efe6a5140e77e189fa36727be01b4",
|
|
3266
|
+
"signature": "6869bda9a903b7fb311947f1f1b107a0f4e8ac8c4f1ca0613b77809276d20cef",
|
|
3267
|
+
"affectsGlobalScope": false
|
|
3268
|
+
},
|
|
3269
|
+
"../src/migrations/1685128263295-external-request-update.ts": {
|
|
3270
|
+
"version": "42a088cec62a5aec977d89940e5d2d842365f8d3eed0524839eb2591b991211b",
|
|
3271
|
+
"signature": "3911090dc53367cd46bdbd59297c8b2e5c1f55ab13960bd178302a448ff59315",
|
|
3272
|
+
"affectsGlobalScope": false
|
|
3273
|
+
},
|
|
3264
3274
|
"../src/migrations/execute/index.ts": {
|
|
3265
3275
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3266
3276
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -6082,6 +6092,12 @@
|
|
|
6082
6092
|
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
6083
6093
|
"../node_modules/typeorm/index.d.ts"
|
|
6084
6094
|
],
|
|
6095
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
6096
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6097
|
+
],
|
|
6098
|
+
"../src/migrations/1685128263295-external-request-update.ts": [
|
|
6099
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6100
|
+
],
|
|
6085
6101
|
"../src/migrations/execute/index.ts": [
|
|
6086
6102
|
"../src/config/connect.ts"
|
|
6087
6103
|
],
|
|
@@ -8758,6 +8774,12 @@
|
|
|
8758
8774
|
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
8759
8775
|
"../node_modules/typeorm/index.d.ts"
|
|
8760
8776
|
],
|
|
8777
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
8778
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8779
|
+
],
|
|
8780
|
+
"../src/migrations/1685128263295-external-request-update.ts": [
|
|
8781
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8782
|
+
],
|
|
8761
8783
|
"../src/migrations/index.ts": [
|
|
8762
8784
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8763
8785
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -9558,6 +9580,8 @@
|
|
|
9558
9580
|
"../src/migrations/1684452127341-externalrequest_v1.ts",
|
|
9559
9581
|
"../src/migrations/1684452476996-externalrequest_v2.ts",
|
|
9560
9582
|
"../src/migrations/1684935064606-shopify-conn.ts",
|
|
9583
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts",
|
|
9584
|
+
"../src/migrations/1685128263295-external-request-update.ts",
|
|
9561
9585
|
"../src/migrations/execute/index.ts",
|
|
9562
9586
|
"../src/migrations/index.ts",
|
|
9563
9587
|
"../src/repositories/index.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reachu/database",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.76",
|
|
4
4
|
"description": "reachu-database",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"author": "reachu",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@reachu/logger": "1.0.
|
|
25
|
-
"@reachu/utils": "1.0.
|
|
24
|
+
"@reachu/logger": "1.0.76",
|
|
25
|
+
"@reachu/utils": "1.0.76",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity, PrimaryGeneratedColumn, Column, JoinColumn, ManyToOne } from 'typeorm';
|
|
2
2
|
import AuditedModel from './AuditedModel';
|
|
3
|
-
import Plan from './modules/subscriptions/Plan'
|
|
3
|
+
import Plan from './modules/subscriptions/Plan';
|
|
4
4
|
import User from './User';
|
|
5
5
|
|
|
6
6
|
@Entity()
|
|
@@ -18,10 +18,10 @@ export default class ExternalRequest extends AuditedModel {
|
|
|
18
18
|
|
|
19
19
|
@Column('varchar')
|
|
20
20
|
receiverEmail: string;
|
|
21
|
-
|
|
22
|
-
@Column('
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
|
|
22
|
+
@Column('varchar', { nullable: true })
|
|
23
|
+
collectionIds: string;
|
|
24
|
+
|
|
25
25
|
@Column('varchar')
|
|
26
26
|
url: string;
|
|
27
27
|
|
|
@@ -5,11 +5,14 @@ import {
|
|
|
5
5
|
JoinColumn,
|
|
6
6
|
OneToOne,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
|
+
Unique,
|
|
8
9
|
} from 'typeorm';
|
|
9
10
|
import User from './User';
|
|
10
11
|
import AuditedModel from './AuditedModel';
|
|
11
12
|
|
|
12
13
|
@Entity()
|
|
14
|
+
@Unique(['supplier', 'deletedAt'])
|
|
15
|
+
@Unique(['reseller', 'deletedAt'])
|
|
13
16
|
export default class ShopifyConnection extends AuditedModel {
|
|
14
17
|
@PrimaryGeneratedColumn()
|
|
15
18
|
id: number;
|
|
@@ -20,11 +23,11 @@ export default class ShopifyConnection extends AuditedModel {
|
|
|
20
23
|
@Column({ type: 'boolean', default: false })
|
|
21
24
|
importedProducts: boolean;
|
|
22
25
|
|
|
23
|
-
@OneToOne(() => User, (user) => user.shopifyReseller, { onDelete: 'CASCADE' })
|
|
24
|
-
@JoinColumn()
|
|
26
|
+
@OneToOne(() => User, (user) => user.shopifyReseller, { onDelete: 'CASCADE', nullable: true })
|
|
27
|
+
@JoinColumn({})
|
|
25
28
|
reseller: User;
|
|
26
29
|
|
|
27
|
-
@OneToOne(() => User, (user) => user.shopifySupplier, { onDelete: 'CASCADE' })
|
|
30
|
+
@OneToOne(() => User, (user) => user.shopifySupplier, { onDelete: 'CASCADE', nullable: true })
|
|
28
31
|
@JoinColumn()
|
|
29
32
|
supplier: User;
|
|
30
33
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class shopifyConn21684975416295 implements MigrationInterface {
|
|
4
|
+
name = 'shopifyConn21684975416295'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\` (\`reseller_id\`, \`deleted_at\`)`);
|
|
8
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\` (\`supplier_id\`, \`deleted_at\`)`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
await queryRunner.query(`DROP INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\``);
|
|
13
|
+
await queryRunner.query(`DROP INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\``);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class externalRequestUpdate1685128263295 implements MigrationInterface {
|
|
4
|
+
name = 'externalRequestUpdate1685128263295'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`DROP INDEX \`IDX_9499974cf522429803e172a627\` ON \`shopify_connection\``);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD UNIQUE INDEX \`IDX_9499974cf522429803e172a627\` (\`reseller_id\`)`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD UNIQUE INDEX \`IDX_98158a497be5c13a12fad50554\` (\`supplier_id\`)`);
|
|
10
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\` (\`reseller_id\`, \`deleted_at\`)`);
|
|
11
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\` (\`supplier_id\`, \`deleted_at\`)`);
|
|
12
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`REL_9499974cf522429803e172a627\` ON \`shopify_connection\` (\`reseller_id\`)`);
|
|
13
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`REL_98158a497be5c13a12fad50554\` ON \`shopify_connection\` (\`supplier_id\`)`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_98158a497be5c13a12fad50554a\` FOREIGN KEY (\`supplier_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
19
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_98158a497be5c13a12fad50554a\``);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
|
|
21
|
+
await queryRunner.query(`DROP INDEX \`REL_98158a497be5c13a12fad50554\` ON \`shopify_connection\``);
|
|
22
|
+
await queryRunner.query(`DROP INDEX \`REL_9499974cf522429803e172a627\` ON \`shopify_connection\``);
|
|
23
|
+
await queryRunner.query(`DROP INDEX \`IDX_dbb543b4ed601764a19df997bb\` ON \`shopify_connection\``);
|
|
24
|
+
await queryRunner.query(`DROP INDEX \`IDX_db41f18c3701a209c734457fa3\` ON \`shopify_connection\``);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP INDEX \`IDX_98158a497be5c13a12fad50554\``);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP INDEX \`IDX_9499974cf522429803e172a627\``);
|
|
27
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_9499974cf522429803e172a627\` ON \`shopify_connection\` (\`reseller_id\`)`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|