@reachu/database 1.0.117 → 1.0.119
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/ProductDigital.d.ts +15 -0
- package/dist/entity/ProductDigital.js +37 -2
- package/dist/entity/ProductDigital.js.map +1 -1
- package/dist/migrations/1696260773644-digital_update.d.ts +6 -0
- package/dist/migrations/1696260773644-digital_update.js +39 -0
- package/dist/migrations/1696260773644-digital_update.js.map +1 -0
- package/dist/migrations/1696266360829-digital_update_01.d.ts +6 -0
- package/dist/migrations/1696266360829-digital_update_01.js +35 -0
- package/dist/migrations/1696266360829-digital_update_01.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +28 -2
- package/package.json +3 -3
- package/src/entity/ProductDigital.ts +30 -0
- package/src/migrations/1696260773644-digital_update.ts +24 -0
- package/src/migrations/1696266360829-digital_update_01.ts +20 -0
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import AuditedModel from './AuditedModel';
|
|
2
2
|
import { Product } from './Product.entity';
|
|
3
|
+
import { Price } from './Price.entity';
|
|
4
|
+
export declare enum _type {
|
|
5
|
+
downloadable = 1,
|
|
6
|
+
sample = 2,
|
|
7
|
+
link = 3
|
|
8
|
+
}
|
|
9
|
+
export declare enum _shareable {
|
|
10
|
+
yes = 1,
|
|
11
|
+
no = 2,
|
|
12
|
+
useConfig = 3
|
|
13
|
+
}
|
|
3
14
|
export default class ProductDigital extends AuditedModel {
|
|
4
15
|
id: number;
|
|
5
16
|
deletedAt: Date;
|
|
6
17
|
file_url: string;
|
|
7
18
|
file_size: number;
|
|
19
|
+
shareable: _shareable | null;
|
|
20
|
+
type: _type | null;
|
|
21
|
+
productDigital: ProductDigital;
|
|
22
|
+
price: Price;
|
|
8
23
|
donwload_limit: number;
|
|
9
24
|
expiration_date: Date;
|
|
10
25
|
product: Product;
|
|
@@ -11,11 +11,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
|
+
var ProductDigital_1;
|
|
14
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports._shareable = exports._type = void 0;
|
|
15
17
|
const typeorm_1 = require("typeorm");
|
|
16
18
|
const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
17
19
|
const Product_entity_1 = require("./Product.entity");
|
|
18
|
-
|
|
20
|
+
const Price_entity_1 = require("./Price.entity");
|
|
21
|
+
var _type;
|
|
22
|
+
(function (_type) {
|
|
23
|
+
_type[_type["downloadable"] = 1] = "downloadable";
|
|
24
|
+
_type[_type["sample"] = 2] = "sample";
|
|
25
|
+
_type[_type["link"] = 3] = "link";
|
|
26
|
+
})(_type = exports._type || (exports._type = {}));
|
|
27
|
+
var _shareable;
|
|
28
|
+
(function (_shareable) {
|
|
29
|
+
_shareable[_shareable["yes"] = 1] = "yes";
|
|
30
|
+
_shareable[_shareable["no"] = 2] = "no";
|
|
31
|
+
_shareable[_shareable["useConfig"] = 3] = "useConfig";
|
|
32
|
+
})(_shareable = exports._shareable || (exports._shareable = {}));
|
|
33
|
+
let ProductDigital = ProductDigital_1 = class ProductDigital extends AuditedModel_1.default {
|
|
19
34
|
};
|
|
20
35
|
__decorate([
|
|
21
36
|
typeorm_1.PrimaryGeneratedColumn(),
|
|
@@ -33,6 +48,26 @@ __decorate([
|
|
|
33
48
|
typeorm_1.Column('integer', { nullable: true }),
|
|
34
49
|
__metadata("design:type", Number)
|
|
35
50
|
], ProductDigital.prototype, "file_size", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
typeorm_1.Column('integer', { nullable: true }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], ProductDigital.prototype, "shareable", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
typeorm_1.Column('integer', { nullable: true }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], ProductDigital.prototype, "type", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
typeorm_1.OneToOne(() => ProductDigital_1, (productDigital) => productDigital.id, {
|
|
61
|
+
eager: false,
|
|
62
|
+
nullable: true,
|
|
63
|
+
}),
|
|
64
|
+
typeorm_1.JoinColumn(),
|
|
65
|
+
__metadata("design:type", ProductDigital)
|
|
66
|
+
], ProductDigital.prototype, "productDigital", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
typeorm_1.Column(() => Price_entity_1.Price, { prefix: 'price_' }),
|
|
69
|
+
__metadata("design:type", Price_entity_1.Price)
|
|
70
|
+
], ProductDigital.prototype, "price", void 0);
|
|
36
71
|
__decorate([
|
|
37
72
|
typeorm_1.Column('integer', { nullable: true }),
|
|
38
73
|
__metadata("design:type", Number)
|
|
@@ -52,7 +87,7 @@ __decorate([
|
|
|
52
87
|
typeorm_1.Column('text', { nullable: false }),
|
|
53
88
|
__metadata("design:type", String)
|
|
54
89
|
], ProductDigital.prototype, "name", void 0);
|
|
55
|
-
ProductDigital = __decorate([
|
|
90
|
+
ProductDigital = ProductDigital_1 = __decorate([
|
|
56
91
|
typeorm_1.Entity()
|
|
57
92
|
], ProductDigital);
|
|
58
93
|
exports.default = ProductDigital;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDigital.js","sourceRoot":"","sources":["../../src/entity/ProductDigital.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductDigital.js","sourceRoot":"","sources":["../../src/entity/ProductDigital.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,kEAA0C;AAC1C,qDAA2C;AAC3C,iDAAuC;AAEvC,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,iDAAgB,CAAA;IAChB,qCAAU,CAAA;IACV,iCAAQ,CAAA;AACV,CAAC,EAJW,KAAK,GAAL,aAAK,KAAL,aAAK,QAIhB;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,yCAAO,CAAA;IACP,uCAAM,CAAA;IACN,qDAAa,CAAA;AACf,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAGD,IAAqB,cAAc,sBAAnC,MAAqB,cAAe,SAAQ,sBAAY;CA2CvD,CAAA;AAzCC;IADC,gCAAsB,EAAE;;0CACd;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;iDAAC;AAGhB;IADC,gBAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACnB;AAGjB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGlB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;AAG7B;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACnB;AAOnB;IALC,kBAAQ,CAAC,GAAG,EAAE,CAAC,gBAAc,EAAE,CAAC,cAA8B,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE;QACrF,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACG,cAAc;sDAAC;AAG/B;IADC,gBAAM,CAAC,GAAG,EAAE,CAAC,oBAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;8BACnC,oBAAK;6CAAC;AAGb;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACf;AAGvB;IADC,gBAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACtB,IAAI;uDAAC;AAMtB;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;QAC1D,KAAK,EAAE,KAAK;KACb,CAAC;IACD,oBAAU,EAAE;8BACJ,wBAAO;+CAAC;AAGjB;IADC,gBAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4CACvB;AA1CM,cAAc;IADlC,gBAAM,EAAE;GACY,cAAc,CA2ClC;kBA3CoB,cAAc"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.digitalUpdate1696260773644 = void 0;
|
|
13
|
+
class digitalUpdate1696260773644 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'digitalUpdate1696260773644';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`shareable\` int NULL`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`type\` int NULL`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_amount\` decimal(10,2) NULL`);
|
|
22
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_currency_code\` varchar(255) NULL`);
|
|
23
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_base_amount\` decimal(10,2) NULL`);
|
|
24
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_compare_at\` decimal(10,2) NULL`);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
down(queryRunner) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_compare_at\``);
|
|
30
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_base_amount\``);
|
|
31
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_currency_code\``);
|
|
32
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_amount\``);
|
|
33
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`type\``);
|
|
34
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`shareable\``);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.digitalUpdate1696260773644 = digitalUpdate1696260773644;
|
|
39
|
+
//# sourceMappingURL=1696260773644-digital_update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1696260773644-digital_update.js","sourceRoot":"","sources":["../../src/migrations/1696260773644-digital_update.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,0BAA0B;IAAvC;QACI,SAAI,GAAG,4BAA4B,CAAA;IAoBvC,CAAC;IAlBgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;YACtF,MAAM,WAAW,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;YACjF,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YACxG,MAAM,WAAW,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;QAC3G,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;YACxF,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;YAChF,MAAM,WAAW,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;QACzF,CAAC;KAAA;CAEJ;AArBD,gEAqBC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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.digitalUpdate011696266360829 = void 0;
|
|
13
|
+
class digitalUpdate011696266360829 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'digitalUpdate011696266360829';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`product_digital_id\` int NULL`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD UNIQUE INDEX \`IDX_c6bbcf34d07fb60f39b9852f2a\` (\`product_digital_id\`)`);
|
|
21
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_c6bbcf34d07fb60f39b9852f2a\` ON \`product_digital\` (\`product_digital_id\`)`);
|
|
22
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD CONSTRAINT \`FK_c6bbcf34d07fb60f39b9852f2a7\` FOREIGN KEY (\`product_digital_id\`) REFERENCES \`product_digital\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
down(queryRunner) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP FOREIGN KEY \`FK_c6bbcf34d07fb60f39b9852f2a7\``);
|
|
28
|
+
yield queryRunner.query(`DROP INDEX \`REL_c6bbcf34d07fb60f39b9852f2a\` ON \`product_digital\``);
|
|
29
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP INDEX \`IDX_c6bbcf34d07fb60f39b9852f2a\``);
|
|
30
|
+
yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`product_digital_id\``);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.digitalUpdate011696266360829 = digitalUpdate011696266360829;
|
|
35
|
+
//# sourceMappingURL=1696266360829-digital_update_01.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1696266360829-digital_update_01.js","sourceRoot":"","sources":["../../src/migrations/1696266360829-digital_update_01.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,4BAA4B;IAAzC;QACI,SAAI,GAAG,8BAA8B,CAAA;IAgBzC,CAAC;IAdgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,8GAA8G,CAAC,CAAC;YACxI,MAAM,WAAW,CAAC,KAAK,CAAC,wGAAwG,CAAC,CAAC;YAClI,MAAM,WAAW,CAAC,KAAK,CAAC,uMAAuM,CAAC,CAAC;QACrO,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,qFAAqF,CAAC,CAAC;YAC/G,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAChG,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;QAClG,CAAC;KAAA;CAEJ;AAjBD,oEAiBC"}
|
|
@@ -2652,8 +2652,8 @@
|
|
|
2652
2652
|
"affectsGlobalScope": false
|
|
2653
2653
|
},
|
|
2654
2654
|
"../src/entity/productdigital.ts": {
|
|
2655
|
-
"version": "
|
|
2656
|
-
"signature": "
|
|
2655
|
+
"version": "f0ca4a34d16d663b3031b9fbd09a52f3eb7e568c93fa2bc0f7f3cd11945e48d6",
|
|
2656
|
+
"signature": "8f74d4f5808582816a8d96b82e001ffcb03cdf3ce56386c2c1fce058cdfa28cd",
|
|
2657
2657
|
"affectsGlobalScope": false
|
|
2658
2658
|
},
|
|
2659
2659
|
"../src/entity/modules/templates/endpointtemplateecommerce.ts": {
|
|
@@ -3536,6 +3536,16 @@
|
|
|
3536
3536
|
"signature": "a44b995de12ecde750895d72b61706ba5c063712ea3d2f505597b008f04b92dc",
|
|
3537
3537
|
"affectsGlobalScope": false
|
|
3538
3538
|
},
|
|
3539
|
+
"../src/migrations/1696260773644-digital_update.ts": {
|
|
3540
|
+
"version": "6404297868af37ec46a3efe1be36495c2da2160e517cc88acdec344cbf0b2fbb",
|
|
3541
|
+
"signature": "cf2e36d8c426105d3bfa35434a87703808127355e0bb8e6cbe3e156790d40f6f",
|
|
3542
|
+
"affectsGlobalScope": false
|
|
3543
|
+
},
|
|
3544
|
+
"../src/migrations/1696266360829-digital_update_01.ts": {
|
|
3545
|
+
"version": "50ba2224d396bb4eac8b43170f15a948d8109d5d1da4db3455542a5358f44357",
|
|
3546
|
+
"signature": "660f9871aa3be94831d2cd273000d246afd1819aa2832359a1daa1be6e03ce15",
|
|
3547
|
+
"affectsGlobalScope": false
|
|
3548
|
+
},
|
|
3539
3549
|
"../src/migrations/execute/index.ts": {
|
|
3540
3550
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3541
3551
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -6059,6 +6069,7 @@
|
|
|
6059
6069
|
"../src/entity/productdigital.ts": [
|
|
6060
6070
|
"../node_modules/typeorm/index.d.ts",
|
|
6061
6071
|
"../src/entity/auditedmodel.ts",
|
|
6072
|
+
"../src/entity/price.entity.ts",
|
|
6062
6073
|
"../src/entity/product.entity.ts"
|
|
6063
6074
|
],
|
|
6064
6075
|
"../src/entity/request.ts": [
|
|
@@ -6558,6 +6569,12 @@
|
|
|
6558
6569
|
"../src/migrations/1695907880854-digital-product-v-2.ts": [
|
|
6559
6570
|
"../node_modules/typeorm/index.d.ts"
|
|
6560
6571
|
],
|
|
6572
|
+
"../src/migrations/1696260773644-digital_update.ts": [
|
|
6573
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6574
|
+
],
|
|
6575
|
+
"../src/migrations/1696266360829-digital_update_01.ts": [
|
|
6576
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6577
|
+
],
|
|
6561
6578
|
"../src/migrations/execute/index.ts": [
|
|
6562
6579
|
"../src/config/connect.ts"
|
|
6563
6580
|
],
|
|
@@ -8979,6 +8996,7 @@
|
|
|
8979
8996
|
],
|
|
8980
8997
|
"../src/entity/productdigital.ts": [
|
|
8981
8998
|
"../src/entity/auditedmodel.ts",
|
|
8999
|
+
"../src/entity/price.entity.ts",
|
|
8982
9000
|
"../src/entity/product.entity.ts"
|
|
8983
9001
|
],
|
|
8984
9002
|
"../src/entity/request.ts": [
|
|
@@ -9435,6 +9453,12 @@
|
|
|
9435
9453
|
"../src/migrations/1695907880854-digital-product-v-2.ts": [
|
|
9436
9454
|
"../node_modules/typeorm/index.d.ts"
|
|
9437
9455
|
],
|
|
9456
|
+
"../src/migrations/1696260773644-digital_update.ts": [
|
|
9457
|
+
"../node_modules/typeorm/index.d.ts"
|
|
9458
|
+
],
|
|
9459
|
+
"../src/migrations/1696266360829-digital_update_01.ts": [
|
|
9460
|
+
"../node_modules/typeorm/index.d.ts"
|
|
9461
|
+
],
|
|
9438
9462
|
"../src/migrations/index.ts": [
|
|
9439
9463
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
9440
9464
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -10300,6 +10324,8 @@
|
|
|
10300
10324
|
"../src/migrations/1695123846329-imported_magento_1.ts",
|
|
10301
10325
|
"../src/migrations/1695658039275-digital-product-v-1.ts",
|
|
10302
10326
|
"../src/migrations/1695907880854-digital-product-v-2.ts",
|
|
10327
|
+
"../src/migrations/1696260773644-digital_update.ts",
|
|
10328
|
+
"../src/migrations/1696266360829-digital_update_01.ts",
|
|
10303
10329
|
"../src/migrations/execute/index.ts",
|
|
10304
10330
|
"../src/migrations/index.ts",
|
|
10305
10331
|
"../src/repositories/discount/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.119",
|
|
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.119",
|
|
25
|
+
"@reachu/utils": "1.0.119",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -5,9 +5,23 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
JoinColumn,
|
|
7
7
|
Column,
|
|
8
|
+
OneToOne,
|
|
8
9
|
} from 'typeorm';
|
|
9
10
|
import AuditedModel from './AuditedModel';
|
|
10
11
|
import { Product } from './Product.entity';
|
|
12
|
+
import { Price } from './Price.entity';
|
|
13
|
+
|
|
14
|
+
export enum _type {
|
|
15
|
+
downloadable = 1,
|
|
16
|
+
sample = 2,
|
|
17
|
+
link = 3,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export enum _shareable {
|
|
21
|
+
yes = 1,
|
|
22
|
+
no = 2,
|
|
23
|
+
useConfig = 3,
|
|
24
|
+
}
|
|
11
25
|
|
|
12
26
|
@Entity()
|
|
13
27
|
export default class ProductDigital extends AuditedModel {
|
|
@@ -23,6 +37,22 @@ export default class ProductDigital extends AuditedModel {
|
|
|
23
37
|
@Column('integer', { nullable: true })
|
|
24
38
|
file_size: number;
|
|
25
39
|
|
|
40
|
+
@Column('integer', { nullable: true })
|
|
41
|
+
shareable: _shareable | null;
|
|
42
|
+
|
|
43
|
+
@Column('integer', { nullable: true })
|
|
44
|
+
type: _type | null;
|
|
45
|
+
|
|
46
|
+
@OneToOne(() => ProductDigital, (productDigital: ProductDigital) => productDigital.id, {
|
|
47
|
+
eager: false,
|
|
48
|
+
nullable: true,
|
|
49
|
+
})
|
|
50
|
+
@JoinColumn()
|
|
51
|
+
productDigital: ProductDigital;
|
|
52
|
+
|
|
53
|
+
@Column(() => Price, { prefix: 'price_' })
|
|
54
|
+
price: Price;
|
|
55
|
+
|
|
26
56
|
@Column('integer', { nullable: true })
|
|
27
57
|
donwload_limit: number;
|
|
28
58
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class digitalUpdate1696260773644 implements MigrationInterface {
|
|
4
|
+
name = 'digitalUpdate1696260773644'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`shareable\` int NULL`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`type\` int NULL`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_amount\` decimal(10,2) NULL`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_currency_code\` varchar(255) NULL`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_base_amount\` decimal(10,2) NULL`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`price_compare_at\` decimal(10,2) NULL`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
16
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_compare_at\``);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_base_amount\``);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_currency_code\``);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`price_amount\``);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`type\``);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`shareable\``);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class digitalUpdate011696266360829 implements MigrationInterface {
|
|
4
|
+
name = 'digitalUpdate011696266360829'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`product_digital_id\` int NULL`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD UNIQUE INDEX \`IDX_c6bbcf34d07fb60f39b9852f2a\` (\`product_digital_id\`)`);
|
|
9
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`REL_c6bbcf34d07fb60f39b9852f2a\` ON \`product_digital\` (\`product_digital_id\`)`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` ADD CONSTRAINT \`FK_c6bbcf34d07fb60f39b9852f2a7\` FOREIGN KEY (\`product_digital_id\`) REFERENCES \`product_digital\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP FOREIGN KEY \`FK_c6bbcf34d07fb60f39b9852f2a7\``);
|
|
15
|
+
await queryRunner.query(`DROP INDEX \`REL_c6bbcf34d07fb60f39b9852f2a\` ON \`product_digital\``);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP INDEX \`IDX_c6bbcf34d07fb60f39b9852f2a\``);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`product_digital_id\``);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|