@reachu/database 1.0.74 → 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.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/tsconfig.tsbuildinfo +13 -1
- package/package.json +3 -3
- package/src/entity/ShopifyConnection.ts +6 -3
- package/src/migrations/1684975416295-shopify-conn-2.ts +16 -0
|
@@ -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"}
|
|
@@ -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
|
},
|
|
@@ -3261,6 +3261,11 @@
|
|
|
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
|
+
},
|
|
3264
3269
|
"../src/migrations/execute/index.ts": {
|
|
3265
3270
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3266
3271
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -6082,6 +6087,9 @@
|
|
|
6082
6087
|
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
6083
6088
|
"../node_modules/typeorm/index.d.ts"
|
|
6084
6089
|
],
|
|
6090
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
6091
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6092
|
+
],
|
|
6085
6093
|
"../src/migrations/execute/index.ts": [
|
|
6086
6094
|
"../src/config/connect.ts"
|
|
6087
6095
|
],
|
|
@@ -8758,6 +8766,9 @@
|
|
|
8758
8766
|
"../src/migrations/1684935064606-shopify-conn.ts": [
|
|
8759
8767
|
"../node_modules/typeorm/index.d.ts"
|
|
8760
8768
|
],
|
|
8769
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts": [
|
|
8770
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8771
|
+
],
|
|
8761
8772
|
"../src/migrations/index.ts": [
|
|
8762
8773
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8763
8774
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -9558,6 +9569,7 @@
|
|
|
9558
9569
|
"../src/migrations/1684452127341-externalrequest_v1.ts",
|
|
9559
9570
|
"../src/migrations/1684452476996-externalrequest_v2.ts",
|
|
9560
9571
|
"../src/migrations/1684935064606-shopify-conn.ts",
|
|
9572
|
+
"../src/migrations/1684975416295-shopify-conn-2.ts",
|
|
9561
9573
|
"../src/migrations/execute/index.ts",
|
|
9562
9574
|
"../src/migrations/index.ts",
|
|
9563
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",
|
|
@@ -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
|
+
}
|