@reachu/database 1.0.73 → 1.0.75
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/ShopifyConnection.d.ts +3 -1
- package/dist/entity/ShopifyConnection.js +12 -5
- package/dist/entity/ShopifyConnection.js.map +1 -1
- package/dist/migrations/1684935064606-shopify-conn.d.ts +6 -0
- package/dist/migrations/1684935064606-shopify-conn.js +33 -0
- package/dist/migrations/1684935064606-shopify-conn.js.map +1 -0
- 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/tsconfig.tsbuildinfo +28 -2
- package/package.json +3 -3
- package/src/entity/ShopifyConnection.ts +19 -5
- package/src/migrations/1684935064606-shopify-conn.ts +18 -0
- package/src/migrations/1684975416295-shopify-conn-2.ts +16 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import User from './User';
|
|
2
|
-
|
|
2
|
+
import AuditedModel from './AuditedModel';
|
|
3
|
+
export default class ShopifyConnection extends AuditedModel {
|
|
3
4
|
id: number;
|
|
5
|
+
deletedAt: Date;
|
|
4
6
|
importedProducts: boolean;
|
|
5
7
|
reseller: User;
|
|
6
8
|
supplier: User;
|
|
@@ -14,23 +14,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const User_1 = __importDefault(require("./User"));
|
|
17
|
-
|
|
17
|
+
const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
18
|
+
let ShopifyConnection = class ShopifyConnection extends AuditedModel_1.default {
|
|
18
19
|
};
|
|
19
20
|
__decorate([
|
|
20
21
|
typeorm_1.PrimaryGeneratedColumn(),
|
|
21
22
|
__metadata("design:type", Number)
|
|
22
23
|
], ShopifyConnection.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
typeorm_1.DeleteDateColumn(),
|
|
26
|
+
__metadata("design:type", Date)
|
|
27
|
+
], ShopifyConnection.prototype, "deletedAt", void 0);
|
|
23
28
|
__decorate([
|
|
24
29
|
typeorm_1.Column({ type: 'boolean', default: false }),
|
|
25
30
|
__metadata("design:type", Boolean)
|
|
26
31
|
], ShopifyConnection.prototype, "importedProducts", void 0);
|
|
27
32
|
__decorate([
|
|
28
|
-
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifyReseller, { onDelete: 'CASCADE' }),
|
|
29
|
-
typeorm_1.JoinColumn(),
|
|
33
|
+
typeorm_1.OneToOne(() => User_1.default, (user) => user.shopifyReseller, { onDelete: 'CASCADE', nullable: true }),
|
|
34
|
+
typeorm_1.JoinColumn({}),
|
|
30
35
|
__metadata("design:type", User_1.default)
|
|
31
36
|
], ShopifyConnection.prototype, "reseller", void 0);
|
|
32
37
|
__decorate([
|
|
33
|
-
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 }),
|
|
34
39
|
typeorm_1.JoinColumn(),
|
|
35
40
|
__metadata("design:type", User_1.default)
|
|
36
41
|
], ShopifyConnection.prototype, "supplier", void 0);
|
|
@@ -59,7 +64,9 @@ __decorate([
|
|
|
59
64
|
__metadata("design:type", String)
|
|
60
65
|
], ShopifyConnection.prototype, "locationId", void 0);
|
|
61
66
|
ShopifyConnection = __decorate([
|
|
62
|
-
typeorm_1.Entity()
|
|
67
|
+
typeorm_1.Entity(),
|
|
68
|
+
typeorm_1.Unique(['supplier', 'deletedAt']),
|
|
69
|
+
typeorm_1.Unique(['reseller', 'deletedAt'])
|
|
63
70
|
], ShopifyConnection);
|
|
64
71
|
exports.default = ShopifyConnection;
|
|
65
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,33 @@
|
|
|
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.shopifyConn1684935064606 = void 0;
|
|
13
|
+
class shopifyConn1684935064606 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'shopifyConn1684935064606';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`deleted_at\` datetime(6) NULL`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
down(queryRunner) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`deleted_at\``);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`updated_at\``);
|
|
28
|
+
yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`created_at\``);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.shopifyConn1684935064606 = shopifyConn1684935064606;
|
|
33
|
+
//# sourceMappingURL=1684935064606-shopify-conn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1684935064606-shopify-conn.js","sourceRoot":"","sources":["../../src/migrations/1684935064606-shopify-conn.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,wBAAwB;IAArC;QACI,SAAI,GAAG,0BAA0B,CAAA;IAcrC,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,yGAAyG,CAAC,CAAC;YACnI,MAAM,WAAW,CAAC,KAAK,CAAC,wIAAwI,CAAC,CAAC;YAClK,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;QACtG,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;QAC7F,CAAC;KAAA;CAEJ;AAfD,4DAeC"}
|
|
@@ -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"}
|
|
@@ -1997,8 +1997,8 @@
|
|
|
1997
1997
|
"affectsGlobalScope": false
|
|
1998
1998
|
},
|
|
1999
1999
|
"../src/entity/shopifyconnection.ts": {
|
|
2000
|
-
"version": "
|
|
2001
|
-
"signature": "
|
|
2000
|
+
"version": "4b7e50bbff5b7c8c0b482fb445c95fb4f7834112d8c7bf5dc9b7bbc21435cfe0",
|
|
2001
|
+
"signature": "deaaa620213450b2c981971e6fa519cb8e39ada9d97973a431bc95bcb877e4ea",
|
|
2002
2002
|
"affectsGlobalScope": false
|
|
2003
2003
|
},
|
|
2004
2004
|
"../node_modules/@types/node/globals.d.ts": {
|
|
@@ -3256,6 +3256,16 @@
|
|
|
3256
3256
|
"signature": "c4e30a983142c885fadda46bd7ed591a288e328626bf9b271e639bd9413c32bb",
|
|
3257
3257
|
"affectsGlobalScope": false
|
|
3258
3258
|
},
|
|
3259
|
+
"../src/migrations/1684935064606-shopify-conn.ts": {
|
|
3260
|
+
"version": "30e74695fe916d70551bdd6593347da896b04fa8be13008dabdab858c675b387",
|
|
3261
|
+
"signature": "e3453ab701762ed7a0c7f0a2d7f4e915eb5ab7b7dddee752071a2d6268698d86",
|
|
3262
|
+
"affectsGlobalScope": false
|
|
3263
|
+
},
|
|
3264
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": {
|
|
3265
|
+
"version": "a5b2486b18841ca237fc7477488dfb28de7efe6a5140e77e189fa36727be01b4",
|
|
3266
|
+
"signature": "6869bda9a903b7fb311947f1f1b107a0f4e8ac8c4f1ca0613b77809276d20cef",
|
|
3267
|
+
"affectsGlobalScope": false
|
|
3268
|
+
},
|
|
3259
3269
|
"../src/migrations/execute/index.ts": {
|
|
3260
3270
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3261
3271
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -5750,6 +5760,7 @@
|
|
|
5750
5760
|
],
|
|
5751
5761
|
"../src/entity/shopifyconnection.ts": [
|
|
5752
5762
|
"../node_modules/typeorm/index.d.ts",
|
|
5763
|
+
"../src/entity/auditedmodel.ts",
|
|
5753
5764
|
"../src/entity/user.ts"
|
|
5754
5765
|
],
|
|
5755
5766
|
"../src/entity/subcategory.ts": [
|
|
@@ -6073,6 +6084,12 @@
|
|
|
6073
6084
|
"../src/migrations/1684452476996-externalrequest_v2.ts": [
|
|
6074
6085
|
"../node_modules/typeorm/index.d.ts"
|
|
6075
6086
|
],
|
|
6087
|
+
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
6088
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6089
|
+
],
|
|
6090
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
6091
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6092
|
+
],
|
|
6076
6093
|
"../src/migrations/execute/index.ts": [
|
|
6077
6094
|
"../src/config/connect.ts"
|
|
6078
6095
|
],
|
|
@@ -8450,6 +8467,7 @@
|
|
|
8450
8467
|
"../src/entity/role.ts"
|
|
8451
8468
|
],
|
|
8452
8469
|
"../src/entity/shopifyconnection.ts": [
|
|
8470
|
+
"../src/entity/auditedmodel.ts",
|
|
8453
8471
|
"../src/entity/user.ts"
|
|
8454
8472
|
],
|
|
8455
8473
|
"../src/entity/subcategory.ts": [
|
|
@@ -8745,6 +8763,12 @@
|
|
|
8745
8763
|
"../src/migrations/1684452476996-externalrequest_v2.ts": [
|
|
8746
8764
|
"../node_modules/typeorm/index.d.ts"
|
|
8747
8765
|
],
|
|
8766
|
+
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
8767
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8768
|
+
],
|
|
8769
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
8770
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8771
|
+
],
|
|
8748
8772
|
"../src/migrations/index.ts": [
|
|
8749
8773
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8750
8774
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -9544,6 +9568,8 @@
|
|
|
9544
9568
|
"../src/migrations/1684451330738-externalrequest.ts",
|
|
9545
9569
|
"../src/migrations/1684452127341-externalrequest_v1.ts",
|
|
9546
9570
|
"../src/migrations/1684452476996-externalrequest_v2.ts",
|
|
9571
|
+
"../src/migrations/1684935064606-shopify-conn.ts",
|
|
9572
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts",
|
|
9547
9573
|
"../src/migrations/execute/index.ts",
|
|
9548
9574
|
"../src/migrations/index.ts",
|
|
9549
9575
|
"../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.75",
|
|
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.75",
|
|
25
|
+
"@reachu/utils": "1.0.75",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -1,19 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
DeleteDateColumn,
|
|
4
|
+
Entity,
|
|
5
|
+
JoinColumn,
|
|
6
|
+
OneToOne,
|
|
7
|
+
PrimaryGeneratedColumn,
|
|
8
|
+
Unique,
|
|
9
|
+
} from 'typeorm';
|
|
2
10
|
import User from './User';
|
|
11
|
+
import AuditedModel from './AuditedModel';
|
|
3
12
|
|
|
4
13
|
@Entity()
|
|
5
|
-
|
|
14
|
+
@Unique(['supplier', 'deletedAt'])
|
|
15
|
+
@Unique(['reseller', 'deletedAt'])
|
|
16
|
+
export default class ShopifyConnection extends AuditedModel {
|
|
6
17
|
@PrimaryGeneratedColumn()
|
|
7
18
|
id: number;
|
|
8
19
|
|
|
20
|
+
@DeleteDateColumn()
|
|
21
|
+
deletedAt: Date;
|
|
22
|
+
|
|
9
23
|
@Column({ type: 'boolean', default: false })
|
|
10
24
|
importedProducts: boolean;
|
|
11
25
|
|
|
12
|
-
@OneToOne(() => User, (user) => user.shopifyReseller, { onDelete: 'CASCADE' })
|
|
13
|
-
@JoinColumn()
|
|
26
|
+
@OneToOne(() => User, (user) => user.shopifyReseller, { onDelete: 'CASCADE', nullable: true })
|
|
27
|
+
@JoinColumn({})
|
|
14
28
|
reseller: User;
|
|
15
29
|
|
|
16
|
-
@OneToOne(() => User, (user) => user.shopifySupplier, { onDelete: 'CASCADE' })
|
|
30
|
+
@OneToOne(() => User, (user) => user.shopifySupplier, { onDelete: 'CASCADE', nullable: true })
|
|
17
31
|
@JoinColumn()
|
|
18
32
|
supplier: User;
|
|
19
33
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class shopifyConn1684935064606 implements MigrationInterface {
|
|
4
|
+
name = 'shopifyConn1684935064606'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD \`deleted_at\` datetime(6) NULL`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`deleted_at\``);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`updated_at\``);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP COLUMN \`created_at\``);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -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
|
+
}
|