@reachu/database 1.0.195 → 1.0.197
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/ChannelUserProducts.d.ts +2 -1
- package/dist/entity/ChannelUserProducts.js +7 -3
- package/dist/entity/ChannelUserProducts.js.map +1 -1
- package/dist/migrations/1727710054772-channelUserProducts-v3.d.ts +1 -1
- package/dist/migrations/1727710054772-channelUserProducts-v3.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +8 -6
- package/package.json +3 -3
- package/src/entity/ChannelUserProducts.ts +6 -2
- package/src/migrations/1727710054772-channelUserProducts-v3.ts +12 -9
|
@@ -2,11 +2,12 @@ import AuditedModel from './AuditedModel';
|
|
|
2
2
|
import ChannelUser from './ChannelUser';
|
|
3
3
|
import { Price } from './Price.entity';
|
|
4
4
|
import Collection from './Collection';
|
|
5
|
+
import { Product } from './Product.entity';
|
|
5
6
|
export default class ChannelUserProducts extends AuditedModel {
|
|
6
7
|
deletedAt: Date;
|
|
7
8
|
id: number;
|
|
8
9
|
channelUser: ChannelUser;
|
|
9
|
-
|
|
10
|
+
product: Product;
|
|
10
11
|
collection: Collection;
|
|
11
12
|
title?: string;
|
|
12
13
|
description?: string;
|
|
@@ -17,6 +17,7 @@ const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
|
17
17
|
const ChannelUser_1 = __importDefault(require("./ChannelUser"));
|
|
18
18
|
const Price_entity_1 = require("./Price.entity");
|
|
19
19
|
const Collection_1 = __importDefault(require("./Collection"));
|
|
20
|
+
const Product_entity_1 = require("./Product.entity");
|
|
20
21
|
let ChannelUserProducts = class ChannelUserProducts extends AuditedModel_1.default {
|
|
21
22
|
};
|
|
22
23
|
__decorate([
|
|
@@ -35,9 +36,12 @@ __decorate([
|
|
|
35
36
|
__metadata("design:type", ChannelUser_1.default)
|
|
36
37
|
], ChannelUserProducts.prototype, "channelUser", void 0);
|
|
37
38
|
__decorate([
|
|
38
|
-
typeorm_1.
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
typeorm_1.ManyToOne(() => Product_entity_1.Product, (product) => product.id, {
|
|
40
|
+
onDelete: 'CASCADE',
|
|
41
|
+
}),
|
|
42
|
+
typeorm_1.JoinColumn(),
|
|
43
|
+
__metadata("design:type", Product_entity_1.Product)
|
|
44
|
+
], ChannelUserProducts.prototype, "product", void 0);
|
|
41
45
|
__decorate([
|
|
42
46
|
typeorm_1.ManyToOne(() => Collection_1.default, (collection) => collection.id, {
|
|
43
47
|
onDelete: 'CASCADE',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelUserProducts.js","sourceRoot":"","sources":["../../src/entity/ChannelUserProducts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAOiB;AACjB,kEAA0C;AAC1C,gEAAwC;AACxC,iDAAuC;AACvC,8DAAsC;
|
|
1
|
+
{"version":3,"file":"ChannelUserProducts.js","sourceRoot":"","sources":["../../src/entity/ChannelUserProducts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAOiB;AACjB,kEAA0C;AAC1C,gEAAwC;AACxC,iDAAuC;AACvC,8DAAsC;AACtC,qDAA2C;AAG3C,IAAqB,mBAAmB,GAAxC,MAAqB,mBAAoB,SAAQ,sBAAY;CA+D5D,CAAA;AA7DC;IADC,0BAAgB,EAAE;8BACR,IAAI;sDAAC;AAGhB;IADC,gCAAsB,EAAE;;+CACd;AAMX;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,qBAAW,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;QAC7D,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,oBAAU,EAAE;8BACA,qBAAW;wDAAC;AAMzB;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;QACjD,QAAQ,EAAE,SAAS;KACpB,CAAC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ACrB;AAGjB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACtB;AAGhB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACvB;AA9DI,mBAAmB;IADvC,gBAAM,EAAE;GACY,mBAAmB,CA+DvC;kBA/DoB,mBAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
2
|
export declare class channelUserProductsV31727710054772 implements MigrationInterface {
|
|
3
3
|
name: string;
|
|
4
4
|
up(queryRunner: QueryRunner): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1727710054772-channelUserProducts-v3.js","sourceRoot":"","sources":["../../src/migrations/1727710054772-channelUserProducts-v3.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,kCAAkC;IAA/C;
|
|
1
|
+
{"version":3,"file":"1727710054772-channelUserProducts-v3.js","sourceRoot":"","sources":["../../src/migrations/1727710054772-channelUserProducts-v3.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,kCAAkC;IAA/C;QACE,SAAI,GAAG,oCAAoC,CAAC;IAa9C,CAAC;IAXc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB,2LAA2L,CAC5L,CAAC;QACJ,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CACrB,2FAA2F,CAC5F,CAAC;QACJ,CAAC;KAAA;CACF;AAdD,gFAcC"}
|
|
@@ -2792,8 +2792,8 @@
|
|
|
2792
2792
|
"affectsGlobalScope": false
|
|
2793
2793
|
},
|
|
2794
2794
|
"../src/entity/channeluserproducts.ts": {
|
|
2795
|
-
"version": "
|
|
2796
|
-
"signature": "
|
|
2795
|
+
"version": "eb4d45ef14d9f33a2f6867d7700bd76eccc24ceefae6bc0994cdc163f147c932",
|
|
2796
|
+
"signature": "83ddaf86a273f5375ca7d96699fceb1bb4323642aa794b9f0ffdb805c7317f28",
|
|
2797
2797
|
"affectsGlobalScope": false
|
|
2798
2798
|
},
|
|
2799
2799
|
"../src/entity/index.ts": {
|
|
@@ -3822,8 +3822,8 @@
|
|
|
3822
3822
|
"affectsGlobalScope": false
|
|
3823
3823
|
},
|
|
3824
3824
|
"../src/migrations/1727710054772-channeluserproducts-v3.ts": {
|
|
3825
|
-
"version": "
|
|
3826
|
-
"signature": "
|
|
3825
|
+
"version": "2cead5e301e148130ed5da970007574cb696166c723da45057edcb11c4b60dad",
|
|
3826
|
+
"signature": "437473d937e2ad1f334165bc4b868e5a6b75f99bc3f48bee34d2809596b884f7",
|
|
3827
3827
|
"affectsGlobalScope": false
|
|
3828
3828
|
},
|
|
3829
3829
|
"../src/migrations/execute/index.ts": {
|
|
@@ -5842,7 +5842,8 @@
|
|
|
5842
5842
|
"../src/entity/auditedmodel.ts",
|
|
5843
5843
|
"../src/entity/channeluser.ts",
|
|
5844
5844
|
"../src/entity/collection.ts",
|
|
5845
|
-
"../src/entity/price.entity.ts"
|
|
5845
|
+
"../src/entity/price.entity.ts",
|
|
5846
|
+
"../src/entity/product.entity.ts"
|
|
5846
5847
|
],
|
|
5847
5848
|
"../src/entity/channeluserproductsync.ts": [
|
|
5848
5849
|
"../node_modules/typeorm/index.d.ts",
|
|
@@ -9070,7 +9071,8 @@
|
|
|
9070
9071
|
"../src/entity/auditedmodel.ts",
|
|
9071
9072
|
"../src/entity/channeluser.ts",
|
|
9072
9073
|
"../src/entity/collection.ts",
|
|
9073
|
-
"../src/entity/price.entity.ts"
|
|
9074
|
+
"../src/entity/price.entity.ts",
|
|
9075
|
+
"../src/entity/product.entity.ts"
|
|
9074
9076
|
],
|
|
9075
9077
|
"../src/entity/channeluserproductsync.ts": [
|
|
9076
9078
|
"../src/entity/auditedmodel.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reachu/database",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.197",
|
|
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.197",
|
|
25
|
+
"@reachu/utils": "1.0.197",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -10,6 +10,7 @@ import AuditedModel from './AuditedModel';
|
|
|
10
10
|
import ChannelUser from './ChannelUser';
|
|
11
11
|
import { Price } from './Price.entity';
|
|
12
12
|
import Collection from './Collection';
|
|
13
|
+
import { Product } from './Product.entity';
|
|
13
14
|
|
|
14
15
|
@Entity()
|
|
15
16
|
export default class ChannelUserProducts extends AuditedModel {
|
|
@@ -25,8 +26,11 @@ export default class ChannelUserProducts extends AuditedModel {
|
|
|
25
26
|
@JoinColumn()
|
|
26
27
|
channelUser: ChannelUser;
|
|
27
28
|
|
|
28
|
-
@
|
|
29
|
-
|
|
29
|
+
@ManyToOne(() => Product, (product) => product.id, {
|
|
30
|
+
onDelete: 'CASCADE',
|
|
31
|
+
})
|
|
32
|
+
@JoinColumn()
|
|
33
|
+
product: Product;
|
|
30
34
|
|
|
31
35
|
@ManyToOne(() => Collection, (collection) => collection.id, {
|
|
32
36
|
onDelete: 'CASCADE',
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {MigrationInterface, QueryRunner} from
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
2
|
|
|
3
3
|
export class channelUserProductsV31727710054772 implements MigrationInterface {
|
|
4
|
-
|
|
4
|
+
name = 'channelUserProductsV31727710054772';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
await queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_ef37d3e38597aa6352c51ca2d57\``);
|
|
12
|
-
}
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_ef37d3e38597aa6352c51ca2d57\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
9
|
+
);
|
|
10
|
+
}
|
|
13
11
|
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_ef37d3e38597aa6352c51ca2d57\``,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
14
17
|
}
|