@reachu/database 1.0.2 → 1.0.4
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/Subcategory.d.ts +3 -1
- package/dist/entity/Subcategory.js +6 -1
- package/dist/entity/Subcategory.js.map +1 -1
- package/dist/entity/modules/shipping/ProductShipping.d.ts +2 -0
- package/dist/entity/modules/shipping/ProductShipping.js +5 -0
- package/dist/entity/modules/shipping/ProductShipping.js.map +1 -1
- package/dist/entity/modules/shopcart/CartItem.d.ts +2 -0
- package/dist/entity/modules/shopcart/CartItem.js +6 -0
- package/dist/entity/modules/shopcart/CartItem.js.map +1 -1
- package/dist/migrations/1677763068338-task-1032V1.d.ts +6 -0
- package/dist/migrations/1677763068338-task-1032V1.js +51 -0
- package/dist/migrations/1677763068338-task-1032V1.js.map +1 -0
- package/dist/migrations/1677764464274-task-1032V2.d.ts +6 -0
- package/dist/migrations/1677764464274-task-1032V2.js +33 -0
- package/dist/migrations/1677764464274-task-1032V2.js.map +1 -0
- package/dist/migrations/1678113864577-task-1098V1.d.ts +6 -0
- package/dist/migrations/1678113864577-task-1098V1.js +31 -0
- package/dist/migrations/1678113864577-task-1098V1.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +106 -64
- package/package.json +3 -3
- package/src/entity/Subcategory.ts +6 -2
- package/src/entity/modules/shipping/ProductShipping.ts +5 -0
- package/src/entity/modules/shopcart/CartItem.ts +9 -0
- package/src/migrations/1677763068338-task-1032V1.ts +57 -0
- package/src/migrations/1677764464274-task-1032V2.ts +18 -0
- package/src/migrations/1678113864577-task-1098V1.ts +16 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import AuditedModel from './AuditedModel';
|
|
1
2
|
import Category from './Category';
|
|
2
|
-
export default class Subcategory {
|
|
3
|
+
export default class Subcategory extends AuditedModel {
|
|
3
4
|
id: number;
|
|
5
|
+
deletedAt: Date;
|
|
4
6
|
name: string;
|
|
5
7
|
category: Category;
|
|
6
8
|
static getCacheKey: () => string;
|
|
@@ -13,14 +13,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
+
const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
16
17
|
const Category_1 = __importDefault(require("./Category"));
|
|
17
|
-
let Subcategory = class Subcategory {
|
|
18
|
+
let Subcategory = class Subcategory extends AuditedModel_1.default {
|
|
18
19
|
};
|
|
19
20
|
Subcategory.getCacheKey = () => 'SUBCATEGORIES';
|
|
20
21
|
__decorate([
|
|
21
22
|
typeorm_1.PrimaryGeneratedColumn(),
|
|
22
23
|
__metadata("design:type", Number)
|
|
23
24
|
], Subcategory.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
typeorm_1.DeleteDateColumn(),
|
|
27
|
+
__metadata("design:type", Date)
|
|
28
|
+
], Subcategory.prototype, "deletedAt", void 0);
|
|
24
29
|
__decorate([
|
|
25
30
|
typeorm_1.Column('varchar'),
|
|
26
31
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subcategory.js","sourceRoot":"","sources":["../../src/entity/Subcategory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Subcategory.js","sourceRoot":"","sources":["../../src/entity/Subcategory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAA8F;AAC9F,kEAA0C;AAC1C,0DAAkC;AAGlC,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,sBAAY;CAcpD,CAAA;AADQ,uBAAW,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC;AAX3C;IADC,gCAAsB,EAAE;;uCACd;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;8CAAC;AAGhB;IADC,gBAAM,CAAC,SAAS,CAAC;;yCACL;AAGb;IADC,mBAAS,CAAC,GAAG,EAAE,CAAC,kBAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;8BACvE,kBAAQ;6CAAC;AAXA,WAAW;IAD/B,gBAAM,EAAE;GACY,WAAW,CAc/B;kBAdoB,WAAW"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Product } from '../../Product.entity';
|
|
2
2
|
import AuditedModel from '../../AuditedModel';
|
|
3
3
|
import Shipping from './Shipping';
|
|
4
|
+
import CartItem from '../shopcart/CartItem';
|
|
4
5
|
export default class ProductShipping extends AuditedModel {
|
|
5
6
|
id: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
deletedAt: Date;
|
|
8
9
|
shipping: Shipping;
|
|
9
10
|
product: Product;
|
|
11
|
+
cartItem: CartItem[];
|
|
10
12
|
}
|
|
@@ -16,6 +16,7 @@ const Product_entity_1 = require("../../Product.entity");
|
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
17
|
const AuditedModel_1 = __importDefault(require("../../AuditedModel"));
|
|
18
18
|
const Shipping_1 = __importDefault(require("./Shipping"));
|
|
19
|
+
const CartItem_1 = __importDefault(require("../shopcart/CartItem"));
|
|
19
20
|
let ProductShipping = class ProductShipping extends AuditedModel_1.default {
|
|
20
21
|
};
|
|
21
22
|
__decorate([
|
|
@@ -46,6 +47,10 @@ __decorate([
|
|
|
46
47
|
typeorm_1.JoinColumn(),
|
|
47
48
|
__metadata("design:type", Product_entity_1.Product)
|
|
48
49
|
], ProductShipping.prototype, "product", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
typeorm_1.OneToMany(() => CartItem_1.default, (cartItem) => cartItem.productShipping, { cascade: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], ProductShipping.prototype, "cartItem", void 0);
|
|
49
54
|
ProductShipping = __decorate([
|
|
50
55
|
typeorm_1.Entity()
|
|
51
56
|
], ProductShipping);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductShipping.js","sourceRoot":"","sources":["../../../../src/entity/modules/shipping/ProductShipping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"ProductShipping.js","sourceRoot":"","sources":["../../../../src/entity/modules/shipping/ProductShipping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,qCAQiB;AACjB,sEAA8C;AAC9C,0DAAkC;AAClC,oEAA4C;AAG5C,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;CA0BxD,CAAA;AAxBC;IADC,gCAAsB,CAAC,MAAM,CAAC;;2CACpB;AAGX;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACjB;AAGrB;IADC,0BAAgB,EAAE;8BACR,IAAI;kDAAC;AAOhB;IALC,mBAAS,CAAC,GAAG,EAAE,CAAC,kBAAQ,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE;QAC3E,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,oBAAU,EAAE;8BACH,kBAAQ;iDAAC;AAOnB;IALC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE;QACvE,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,oBAAU,EAAE;8BACJ,wBAAO;gDAAC;AAGjB;IADC,mBAAS,CAAC,GAAG,EAAE,CAAC,kBAAQ,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAC1E;AAzBF,eAAe;IADnC,gBAAM,EAAE;GACY,eAAe,CA0BnC;kBA1BoB,eAAe"}
|
|
@@ -2,6 +2,7 @@ import AuditedModel from '../../AuditedModel';
|
|
|
2
2
|
import { PriceData } from './PriceData';
|
|
3
3
|
import Cart from './Cart';
|
|
4
4
|
import { Product } from '../../Product.entity';
|
|
5
|
+
import ProductShipping from '../shipping/ProductShipping';
|
|
5
6
|
export default class CartItem extends AuditedModel {
|
|
6
7
|
id: string;
|
|
7
8
|
deletedAt: Date;
|
|
@@ -10,4 +11,5 @@ export default class CartItem extends AuditedModel {
|
|
|
10
11
|
quantity?: number;
|
|
11
12
|
priceData: PriceData;
|
|
12
13
|
cart: Cart;
|
|
14
|
+
productShipping: ProductShipping;
|
|
13
15
|
}
|
|
@@ -17,6 +17,7 @@ const AuditedModel_1 = __importDefault(require("../../AuditedModel"));
|
|
|
17
17
|
const PriceData_1 = require("./PriceData");
|
|
18
18
|
const Cart_1 = __importDefault(require("./Cart"));
|
|
19
19
|
const Product_entity_1 = require("../../Product.entity");
|
|
20
|
+
const ProductShipping_1 = __importDefault(require("../shipping/ProductShipping"));
|
|
20
21
|
let CartItem = class CartItem extends AuditedModel_1.default {
|
|
21
22
|
};
|
|
22
23
|
__decorate([
|
|
@@ -50,6 +51,11 @@ __decorate([
|
|
|
50
51
|
typeorm_1.JoinColumn(),
|
|
51
52
|
__metadata("design:type", Cart_1.default)
|
|
52
53
|
], CartItem.prototype, "cart", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
typeorm_1.ManyToOne(() => ProductShipping_1.default, (productShipping) => productShipping.cartItem, { eager: true, onDelete: 'CASCADE' }),
|
|
56
|
+
typeorm_1.JoinColumn(),
|
|
57
|
+
__metadata("design:type", ProductShipping_1.default)
|
|
58
|
+
], CartItem.prototype, "productShipping", void 0);
|
|
53
59
|
CartItem = __decorate([
|
|
54
60
|
typeorm_1.Entity()
|
|
55
61
|
], CartItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/CartItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,2CAAwC;AACxC,kDAA0B;AAC1B,yDAA+C;
|
|
1
|
+
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/CartItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,2CAAwC;AACxC,kDAA0B;AAC1B,yDAA+C;AAC/C,kFAA0D;AAG1D,IAAqB,QAAQ,GAA7B,MAAqB,QAAS,SAAQ,sBAAY;CAgCjD,CAAA;AA9BC;IADC,gCAAsB,CAAC,MAAM,CAAC;;oCACpB;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;2CAAC;AAIhB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACvF,oBAAU,EAAE;8BACJ,wBAAO;yCAAC;AAGjB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACnB;AAGnB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CAChB;AAIlB;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,qBAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC;IAC5D,oBAAU,EAAE;8BACF,qBAAS;2CAAC;AAIrB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC5F,oBAAU,EAAE;8BACP,cAAI;sCAAC;AAQX;IANC,mBAAS,CACR,GAAG,EAAE,CAAC,yBAAe,EACrB,CAAC,eAAgC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAC9D,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CACrC;IACA,oBAAU,EAAE;8BACI,yBAAe;iDAAC;AA/Bd,QAAQ;IAD5B,gBAAM,EAAE;GACY,QAAQ,CAgC5B;kBAhCoB,QAAQ"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.task1032V11677763068338 = void 0;
|
|
13
|
+
class task1032V11677763068338 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'task1032V11677763068338';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`CREATE TABLE \`category_images\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`srcn\` varchar(255) NULL, \`slug\` varchar(255) NULL, \`name\` varchar(255) NULL, \`src\` varchar(255) NULL, \`alt\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
20
|
+
yield queryRunner.query(`CREATE TABLE \`product_attribute\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`attribute_id\` int NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
21
|
+
yield queryRunner.query(`CREATE TABLE \`attribute\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`name\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
22
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
|
|
23
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
|
|
24
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`deleted_at\` datetime(6) NULL`);
|
|
25
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`slug\` varchar(255) NULL`);
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`menu_order\` int NULL`);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD \`category_images_id\` int NULL`);
|
|
28
|
+
yield queryRunner.query(`ALTER TABLE \`category\` ADD CONSTRAINT \`FK_e7068d526cfc9b60374476835ea\` FOREIGN KEY (\`category_images_id\`) REFERENCES \`category_images\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
29
|
+
yield queryRunner.query(`ALTER TABLE \`product_attribute\` ADD CONSTRAINT \`FK_3e2f6a0f059b619505f30b8e54f\` FOREIGN KEY (\`attribute_id\`) REFERENCES \`attribute\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
30
|
+
yield queryRunner.query(`ALTER TABLE \`product_attribute\` ADD CONSTRAINT \`FK_c8f119684d209b55cf5e8b42532\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
down(queryRunner) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield queryRunner.query(`ALTER TABLE \`product_attribute\` DROP FOREIGN KEY \`FK_c8f119684d209b55cf5e8b42532\``);
|
|
36
|
+
yield queryRunner.query(`ALTER TABLE \`product_attribute\` DROP FOREIGN KEY \`FK_3e2f6a0f059b619505f30b8e54f\``);
|
|
37
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP FOREIGN KEY \`FK_e7068d526cfc9b60374476835ea\``);
|
|
38
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`category_images_id\``);
|
|
39
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`menu_order\``);
|
|
40
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`slug\``);
|
|
41
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`deleted_at\``);
|
|
42
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`updated_at\``);
|
|
43
|
+
yield queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`created_at\``);
|
|
44
|
+
yield queryRunner.query(`DROP TABLE \`attribute\``);
|
|
45
|
+
yield queryRunner.query(`DROP TABLE \`product_attribute\``);
|
|
46
|
+
yield queryRunner.query(`DROP TABLE \`category_images\``);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.task1032V11677763068338 = task1032V11677763068338;
|
|
51
|
+
//# sourceMappingURL=1677763068338-task-1032V1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1677763068338-task-1032V1.js","sourceRoot":"","sources":["../../src/migrations/1677763068338-task-1032V1.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,uBAAuB;IAApC;QACE,SAAI,GAAG,yBAAyB,CAAC;IAqDnC,CAAC;IAnDc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB,ybAAyb,CAC1b,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,qWAAqW,CACtW,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,yUAAyU,CAC1U,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,+FAA+F,CAChG,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,8HAA8H,CAC/H,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;YACxF,MAAM,WAAW,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;YACnF,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;YAChF,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;YACxF,MAAM,WAAW,CAAC,KAAK,CACrB,8LAA8L,CAC/L,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,2LAA2L,CAC5L,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,uLAAuL,CACxL,CAAC;QACJ,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CACrB,uFAAuF,CACxF,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,uFAAuF,CACxF,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CACrB,8EAA8E,CAC/E,CAAC;YACF,MAAM,WAAW,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;YACvF,MAAM,WAAW,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;YACzE,MAAM,WAAW,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YACpD,MAAM,WAAW,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAC5D,MAAM,WAAW,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF;AAtDD,0DAsDC"}
|
|
@@ -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.task1032V21677764464274 = void 0;
|
|
13
|
+
class task1032V21677764464274 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'task1032V21677764464274';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`subcategory\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`subcategory\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`subcategory\` 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 \`subcategory\` DROP COLUMN \`deleted_at\``);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`subcategory\` DROP COLUMN \`updated_at\``);
|
|
28
|
+
yield queryRunner.query(`ALTER TABLE \`subcategory\` DROP COLUMN \`created_at\``);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.task1032V21677764464274 = task1032V21677764464274;
|
|
33
|
+
//# sourceMappingURL=1677764464274-task-1032V2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1677764464274-task-1032V2.js","sourceRoot":"","sources":["../../src/migrations/1677764464274-task-1032V2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,uBAAuB;IAApC;QACI,SAAI,GAAG,yBAAyB,CAAA;IAcpC,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,kGAAkG,CAAC,CAAC;YAC5H,MAAM,WAAW,CAAC,KAAK,CAAC,iIAAiI,CAAC,CAAC;YAC3J,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;QAC/F,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YAClF,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YAClF,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACtF,CAAC;KAAA;CAEJ;AAfD,0DAeC"}
|
|
@@ -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.task1098V11678113864577 = void 0;
|
|
13
|
+
class task1098V11678113864577 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'task1098V11678113864577';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`product_shipping_id\` varchar(36) NULL`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_2b97b975f9f05cdc297f89d1287\` FOREIGN KEY (\`product_shipping_id\`) REFERENCES \`product_shipping\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
down(queryRunner) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_2b97b975f9f05cdc297f89d1287\``);
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`product_shipping_id\``);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.task1098V11678113864577 = task1098V11678113864577;
|
|
31
|
+
//# sourceMappingURL=1678113864577-task-1098V1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1678113864577-task-1098V1.js","sourceRoot":"","sources":["../../src/migrations/1678113864577-task-1098V1.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,uBAAuB;IAApC;QACI,SAAI,GAAG,yBAAyB,CAAA;IAYpC,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,iMAAiM,CAAC,CAAC;QAC/N,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;QAC7F,CAAC;KAAA;CAEJ;AAbD,0DAaC"}
|
|
@@ -1927,8 +1927,8 @@
|
|
|
1927
1927
|
"affectsGlobalScope": false
|
|
1928
1928
|
},
|
|
1929
1929
|
"../src/entity/subcategory.ts": {
|
|
1930
|
-
"version": "
|
|
1931
|
-
"signature": "
|
|
1930
|
+
"version": "26b02abbae1a4dd83bc9cfb040ad080a6083938f74557045e8e24a7d394ba782",
|
|
1931
|
+
"signature": "6bab357cec0125bbac6b707fb8c841355bedeb0c56fc4684822a90a7ca390fdb",
|
|
1932
1932
|
"affectsGlobalScope": false
|
|
1933
1933
|
},
|
|
1934
1934
|
"../src/entity/category.ts": {
|
|
@@ -2431,9 +2431,69 @@
|
|
|
2431
2431
|
"signature": "80b9c2757b0d4c3f1a54a57baf0aaf10ba21fe752642f58dca0511bf34e581ba",
|
|
2432
2432
|
"affectsGlobalScope": false
|
|
2433
2433
|
},
|
|
2434
|
+
"../src/entity/modules/shopcart/pricedata.ts": {
|
|
2435
|
+
"version": "8d198c8a4b9ec24a576f38c6ce228e98e23d517ec03c1c7d7d8a4d956665497c",
|
|
2436
|
+
"signature": "13f818e7a8b123df9357122492988375966183e1659533220999b24700bda43f",
|
|
2437
|
+
"affectsGlobalScope": false
|
|
2438
|
+
},
|
|
2439
|
+
"../src/entity/modules/shopcart/checkoutbillingaddress.ts": {
|
|
2440
|
+
"version": "ab0e4e47a0c12af3e6a75a5df1e591a2cb6d83c5c8610e94c894f8347683cd85",
|
|
2441
|
+
"signature": "9034d0b32a3de8ce2025828476521d6713e80c42a63a5d487c0a9add41faa0f6",
|
|
2442
|
+
"affectsGlobalScope": false
|
|
2443
|
+
},
|
|
2444
|
+
"../src/entity/modules/shopcart/checkoutshippingaddress.ts": {
|
|
2445
|
+
"version": "fba937294a8b426bb1d8d9687870a2eca86befdfcab8306fad5fe7cdb7793702",
|
|
2446
|
+
"signature": "90dfe9f4f7f401bf8993564a88653c00f713d646f7002d392ed93da3b72d7f6f",
|
|
2447
|
+
"affectsGlobalScope": false
|
|
2448
|
+
},
|
|
2449
|
+
"../src/entity/paymentshopify.ts": {
|
|
2450
|
+
"version": "f6067f2afa8adeb2895259edd514d16bf8cad492c4520ca628fbef731d2252b0",
|
|
2451
|
+
"signature": "be8e6ec14e0c8f8c1797cb6323226f70746582df3bfd14dc456c734ea19b2aac",
|
|
2452
|
+
"affectsGlobalScope": false
|
|
2453
|
+
},
|
|
2454
|
+
"../src/entity/ordertracking.ts": {
|
|
2455
|
+
"version": "55d465f4fb25912e0c8e9ba44ec0476c972420250f05ae6065c339daf9955e42",
|
|
2456
|
+
"signature": "106654cf79326d89c41b6cf6d98144e39fa5985245bcef3f742916d0f11ac4a0",
|
|
2457
|
+
"affectsGlobalScope": false
|
|
2458
|
+
},
|
|
2459
|
+
"../src/entity/orderitem.ts": {
|
|
2460
|
+
"version": "73b5eb6c0116c5b35b176a5fc6a693e17daf392d85ffa83df7bd217482d9d708",
|
|
2461
|
+
"signature": "8a99f70f1b07ea2c55e8a586b4cafa3ddf7d2c93c73456de5ef1b57fe3ff47bd",
|
|
2462
|
+
"affectsGlobalScope": false
|
|
2463
|
+
},
|
|
2464
|
+
"../src/entity/ordercustomer.ts": {
|
|
2465
|
+
"version": "9f6365bcc286a1b5a8fbb12338b790fbcd6831f3219a27df6a49d70bd0d1b304",
|
|
2466
|
+
"signature": "d2a4453607aa4ee7e7bd9fa3813de5d6e28d1da6fa4623dc6c7cdc5269b3d00b",
|
|
2467
|
+
"affectsGlobalScope": false
|
|
2468
|
+
},
|
|
2469
|
+
"../src/entity/ordershipping.ts": {
|
|
2470
|
+
"version": "403c0ccff160f684973b9bd50e0a6ec3b07089352412c452147ee6850647cc29",
|
|
2471
|
+
"signature": "4d8cf015d972a54879875907c4a6c28adcf3b92574c1bcb348ec00e3564076c5",
|
|
2472
|
+
"affectsGlobalScope": false
|
|
2473
|
+
},
|
|
2474
|
+
"../src/entity/order.ts": {
|
|
2475
|
+
"version": "ff54a094a185cc60062a278d93b053329849797728ada151079833fd938dc20d",
|
|
2476
|
+
"signature": "9eed0ebc86da6c572000543bbc4769d9702b152d0ca454f8e703fed918f4af26",
|
|
2477
|
+
"affectsGlobalScope": false
|
|
2478
|
+
},
|
|
2479
|
+
"../src/entity/modules/shopcart/checkout.ts": {
|
|
2480
|
+
"version": "6a746ec2cdf50db38f74fb8294ab0ecfb87eda85ad1f12aef2b547c078929000",
|
|
2481
|
+
"signature": "41a7de2d69c9ed52ff5df008e4aee8bee1da4165862e1e13cfac4abf984e361a",
|
|
2482
|
+
"affectsGlobalScope": false
|
|
2483
|
+
},
|
|
2484
|
+
"../src/entity/modules/shopcart/cart.ts": {
|
|
2485
|
+
"version": "138d377cbeba92b2fea480cb1b35d5de930d5d3f63da4c5266eb7955d9f53919",
|
|
2486
|
+
"signature": "203972c6ae6a8a4bc90a4d6a7a6ac91559c5d53aed7dc3b2b491222e47d66a6f",
|
|
2487
|
+
"affectsGlobalScope": false
|
|
2488
|
+
},
|
|
2489
|
+
"../src/entity/modules/shopcart/cartitem.ts": {
|
|
2490
|
+
"version": "2aa93857c7df25d33db4143a6505d3c91ef8e4383b9b7e73221fe0911e3d545b",
|
|
2491
|
+
"signature": "2adb5963ab6b2bf2042fa12d08e3608fa8e8ee40ae894c9bca93d5c43ba19c4b",
|
|
2492
|
+
"affectsGlobalScope": false
|
|
2493
|
+
},
|
|
2434
2494
|
"../src/entity/modules/shipping/productshipping.ts": {
|
|
2435
|
-
"version": "
|
|
2436
|
-
"signature": "
|
|
2495
|
+
"version": "2c2c4318913b495e292358d29681fa957b9b4fefafec72ce14569a151b250c3f",
|
|
2496
|
+
"signature": "7bfe342f3b3bc6d3c065c224c471026018b455acbfbb8416a87c718b87ea930a",
|
|
2437
2497
|
"affectsGlobalScope": false
|
|
2438
2498
|
},
|
|
2439
2499
|
"../src/entity/customproductimage.ts": {
|
|
@@ -2526,36 +2586,6 @@
|
|
|
2526
2586
|
"signature": "4404f7653a743163063814d7cc6008012101cefac0416bd141aa081821063f5f",
|
|
2527
2587
|
"affectsGlobalScope": false
|
|
2528
2588
|
},
|
|
2529
|
-
"../src/entity/paymentshopify.ts": {
|
|
2530
|
-
"version": "f6067f2afa8adeb2895259edd514d16bf8cad492c4520ca628fbef731d2252b0",
|
|
2531
|
-
"signature": "be8e6ec14e0c8f8c1797cb6323226f70746582df3bfd14dc456c734ea19b2aac",
|
|
2532
|
-
"affectsGlobalScope": false
|
|
2533
|
-
},
|
|
2534
|
-
"../src/entity/ordertracking.ts": {
|
|
2535
|
-
"version": "55d465f4fb25912e0c8e9ba44ec0476c972420250f05ae6065c339daf9955e42",
|
|
2536
|
-
"signature": "106654cf79326d89c41b6cf6d98144e39fa5985245bcef3f742916d0f11ac4a0",
|
|
2537
|
-
"affectsGlobalScope": false
|
|
2538
|
-
},
|
|
2539
|
-
"../src/entity/orderitem.ts": {
|
|
2540
|
-
"version": "73b5eb6c0116c5b35b176a5fc6a693e17daf392d85ffa83df7bd217482d9d708",
|
|
2541
|
-
"signature": "8a99f70f1b07ea2c55e8a586b4cafa3ddf7d2c93c73456de5ef1b57fe3ff47bd",
|
|
2542
|
-
"affectsGlobalScope": false
|
|
2543
|
-
},
|
|
2544
|
-
"../src/entity/ordercustomer.ts": {
|
|
2545
|
-
"version": "9f6365bcc286a1b5a8fbb12338b790fbcd6831f3219a27df6a49d70bd0d1b304",
|
|
2546
|
-
"signature": "d2a4453607aa4ee7e7bd9fa3813de5d6e28d1da6fa4623dc6c7cdc5269b3d00b",
|
|
2547
|
-
"affectsGlobalScope": false
|
|
2548
|
-
},
|
|
2549
|
-
"../src/entity/ordershipping.ts": {
|
|
2550
|
-
"version": "403c0ccff160f684973b9bd50e0a6ec3b07089352412c452147ee6850647cc29",
|
|
2551
|
-
"signature": "4d8cf015d972a54879875907c4a6c28adcf3b92574c1bcb348ec00e3564076c5",
|
|
2552
|
-
"affectsGlobalScope": false
|
|
2553
|
-
},
|
|
2554
|
-
"../src/entity/order.ts": {
|
|
2555
|
-
"version": "ff54a094a185cc60062a278d93b053329849797728ada151079833fd938dc20d",
|
|
2556
|
-
"signature": "9eed0ebc86da6c572000543bbc4769d9702b152d0ca454f8e703fed918f4af26",
|
|
2557
|
-
"affectsGlobalScope": false
|
|
2558
|
-
},
|
|
2559
2589
|
"../src/entity/request.ts": {
|
|
2560
2590
|
"version": "7a043d86aa89966f51860bc7d153171da83cdfebf31d9c7dd210f5d084659090",
|
|
2561
2591
|
"signature": "92b7103666a311746fe5b80699c10968e75111a1a8e79525269edbcb4f0051cb",
|
|
@@ -2591,36 +2621,6 @@
|
|
|
2591
2621
|
"signature": "edfc427eed5128dec1fecd84338bbbf23d9737b2b637ef70601411e733545186",
|
|
2592
2622
|
"affectsGlobalScope": false
|
|
2593
2623
|
},
|
|
2594
|
-
"../src/entity/modules/shopcart/pricedata.ts": {
|
|
2595
|
-
"version": "8d198c8a4b9ec24a576f38c6ce228e98e23d517ec03c1c7d7d8a4d956665497c",
|
|
2596
|
-
"signature": "13f818e7a8b123df9357122492988375966183e1659533220999b24700bda43f",
|
|
2597
|
-
"affectsGlobalScope": false
|
|
2598
|
-
},
|
|
2599
|
-
"../src/entity/modules/shopcart/cartitem.ts": {
|
|
2600
|
-
"version": "53915949af0f9f5006e3799bc8bca4dccb33083a786412ae5363b09f122d279a",
|
|
2601
|
-
"signature": "f974d743e42395cd23ad2233bdf70e5b8ddaf210dce5ee1afee4cdab28352cc2",
|
|
2602
|
-
"affectsGlobalScope": false
|
|
2603
|
-
},
|
|
2604
|
-
"../src/entity/modules/shopcart/checkoutbillingaddress.ts": {
|
|
2605
|
-
"version": "ab0e4e47a0c12af3e6a75a5df1e591a2cb6d83c5c8610e94c894f8347683cd85",
|
|
2606
|
-
"signature": "9034d0b32a3de8ce2025828476521d6713e80c42a63a5d487c0a9add41faa0f6",
|
|
2607
|
-
"affectsGlobalScope": false
|
|
2608
|
-
},
|
|
2609
|
-
"../src/entity/modules/shopcart/checkoutshippingaddress.ts": {
|
|
2610
|
-
"version": "fba937294a8b426bb1d8d9687870a2eca86befdfcab8306fad5fe7cdb7793702",
|
|
2611
|
-
"signature": "90dfe9f4f7f401bf8993564a88653c00f713d646f7002d392ed93da3b72d7f6f",
|
|
2612
|
-
"affectsGlobalScope": false
|
|
2613
|
-
},
|
|
2614
|
-
"../src/entity/modules/shopcart/checkout.ts": {
|
|
2615
|
-
"version": "6a746ec2cdf50db38f74fb8294ab0ecfb87eda85ad1f12aef2b547c078929000",
|
|
2616
|
-
"signature": "41a7de2d69c9ed52ff5df008e4aee8bee1da4165862e1e13cfac4abf984e361a",
|
|
2617
|
-
"affectsGlobalScope": false
|
|
2618
|
-
},
|
|
2619
|
-
"../src/entity/modules/shopcart/cart.ts": {
|
|
2620
|
-
"version": "138d377cbeba92b2fea480cb1b35d5de930d5d3f63da4c5266eb7955d9f53919",
|
|
2621
|
-
"signature": "203972c6ae6a8a4bc90a4d6a7a6ac91559c5d53aed7dc3b2b491222e47d66a6f",
|
|
2622
|
-
"affectsGlobalScope": false
|
|
2623
|
-
},
|
|
2624
2624
|
"../src/entity/index.ts": {
|
|
2625
2625
|
"version": "144582c2fc899b1b172056c49b698fa1d904a0c0c241bca68ded469236ead98f",
|
|
2626
2626
|
"signature": "c41c2724dee5f5006abbec545a39e37670f3a02b7c049271016b91e2c181f5cb",
|
|
@@ -3001,6 +3001,21 @@
|
|
|
3001
3001
|
"signature": "5c4edd69708ca8a11f2aa55bcf1acfb520678afefba346a893b7697974dbdb8b",
|
|
3002
3002
|
"affectsGlobalScope": false
|
|
3003
3003
|
},
|
|
3004
|
+
"../src/migrations/1677763068338-task-1032v1.ts": {
|
|
3005
|
+
"version": "6e09e6b6ce6e48e85bffe6b253207cec03a637250e194570e90b18573056c6d1",
|
|
3006
|
+
"signature": "a3a7ebedf800879ffa5e04d45d6a73ac216816a05ad67ab63e6671467950a5cf",
|
|
3007
|
+
"affectsGlobalScope": false
|
|
3008
|
+
},
|
|
3009
|
+
"../src/migrations/1677764464274-task-1032v2.ts": {
|
|
3010
|
+
"version": "9b976a871513072a917fe9486edcb2b1cfe06a00030bee40b4b240502c0a76ef",
|
|
3011
|
+
"signature": "0b0c73764a789c14efda2c2211880a22ecb26f1f57921327745ebb29dd3e317b",
|
|
3012
|
+
"affectsGlobalScope": false
|
|
3013
|
+
},
|
|
3014
|
+
"../src/migrations/1678113864577-task-1098v1.ts": {
|
|
3015
|
+
"version": "271195d4c7022d76537b3c66118faae70cfe629edfbd0366aac3fac5ac24ef25",
|
|
3016
|
+
"signature": "fd2aa5d8badb2191af4a7a266cf303aac34b90f7f1a42442cc80600d72fc99cd",
|
|
3017
|
+
"affectsGlobalScope": false
|
|
3018
|
+
},
|
|
3004
3019
|
"../src/migrations/execute/index.ts": {
|
|
3005
3020
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3006
3021
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -5185,6 +5200,7 @@
|
|
|
5185
5200
|
"../node_modules/typeorm/index.d.ts",
|
|
5186
5201
|
"../src/entity/auditedmodel.ts",
|
|
5187
5202
|
"../src/entity/modules/shipping/shipping.ts",
|
|
5203
|
+
"../src/entity/modules/shopcart/cartitem.ts",
|
|
5188
5204
|
"../src/entity/product.entity.ts"
|
|
5189
5205
|
],
|
|
5190
5206
|
"../src/entity/modules/shipping/shipping.ts": [
|
|
@@ -5208,6 +5224,7 @@
|
|
|
5208
5224
|
"../src/entity/modules/shopcart/cartitem.ts": [
|
|
5209
5225
|
"../node_modules/typeorm/index.d.ts",
|
|
5210
5226
|
"../src/entity/auditedmodel.ts",
|
|
5227
|
+
"../src/entity/modules/shipping/productshipping.ts",
|
|
5211
5228
|
"../src/entity/modules/shopcart/cart.ts",
|
|
5212
5229
|
"../src/entity/modules/shopcart/pricedata.ts",
|
|
5213
5230
|
"../src/entity/product.entity.ts"
|
|
@@ -5349,6 +5366,7 @@
|
|
|
5349
5366
|
],
|
|
5350
5367
|
"../src/entity/subcategory.ts": [
|
|
5351
5368
|
"../node_modules/typeorm/index.d.ts",
|
|
5369
|
+
"../src/entity/auditedmodel.ts",
|
|
5352
5370
|
"../src/entity/category.ts"
|
|
5353
5371
|
],
|
|
5354
5372
|
"../src/entity/user.ts": [
|
|
@@ -5583,6 +5601,15 @@
|
|
|
5583
5601
|
"../src/migrations/1677706695399-promote_to_production_2023_01_03.ts": [
|
|
5584
5602
|
"../node_modules/typeorm/index.d.ts"
|
|
5585
5603
|
],
|
|
5604
|
+
"../src/migrations/1677763068338-task-1032v1.ts": [
|
|
5605
|
+
"../node_modules/typeorm/index.d.ts"
|
|
5606
|
+
],
|
|
5607
|
+
"../src/migrations/1677764464274-task-1032v2.ts": [
|
|
5608
|
+
"../node_modules/typeorm/index.d.ts"
|
|
5609
|
+
],
|
|
5610
|
+
"../src/migrations/1678113864577-task-1098v1.ts": [
|
|
5611
|
+
"../node_modules/typeorm/index.d.ts"
|
|
5612
|
+
],
|
|
5586
5613
|
"../src/migrations/execute/index.ts": [
|
|
5587
5614
|
"../src/config/connect.ts"
|
|
5588
5615
|
],
|
|
@@ -7683,6 +7710,7 @@
|
|
|
7683
7710
|
"../src/entity/modules/shipping/productshipping.ts": [
|
|
7684
7711
|
"../src/entity/auditedmodel.ts",
|
|
7685
7712
|
"../src/entity/modules/shipping/shipping.ts",
|
|
7713
|
+
"../src/entity/modules/shopcart/cartitem.ts",
|
|
7686
7714
|
"../src/entity/product.entity.ts"
|
|
7687
7715
|
],
|
|
7688
7716
|
"../src/entity/modules/shipping/shipping.ts": [
|
|
@@ -7702,6 +7730,7 @@
|
|
|
7702
7730
|
],
|
|
7703
7731
|
"../src/entity/modules/shopcart/cartitem.ts": [
|
|
7704
7732
|
"../src/entity/auditedmodel.ts",
|
|
7733
|
+
"../src/entity/modules/shipping/productshipping.ts",
|
|
7705
7734
|
"../src/entity/modules/shopcart/cart.ts",
|
|
7706
7735
|
"../src/entity/modules/shopcart/pricedata.ts",
|
|
7707
7736
|
"../src/entity/product.entity.ts"
|
|
@@ -7805,6 +7834,7 @@
|
|
|
7805
7834
|
"../src/entity/user.ts"
|
|
7806
7835
|
],
|
|
7807
7836
|
"../src/entity/subcategory.ts": [
|
|
7837
|
+
"../src/entity/auditedmodel.ts",
|
|
7808
7838
|
"../src/entity/category.ts"
|
|
7809
7839
|
],
|
|
7810
7840
|
"../src/entity/user.ts": [
|
|
@@ -8013,6 +8043,15 @@
|
|
|
8013
8043
|
"../src/migrations/1677706695399-promote_to_production_2023_01_03.ts": [
|
|
8014
8044
|
"../node_modules/typeorm/index.d.ts"
|
|
8015
8045
|
],
|
|
8046
|
+
"../src/migrations/1677763068338-task-1032v1.ts": [
|
|
8047
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8048
|
+
],
|
|
8049
|
+
"../src/migrations/1677764464274-task-1032v2.ts": [
|
|
8050
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8051
|
+
],
|
|
8052
|
+
"../src/migrations/1678113864577-task-1098v1.ts": [
|
|
8053
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8054
|
+
],
|
|
8016
8055
|
"../src/migrations/index.ts": [
|
|
8017
8056
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8018
8057
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -8734,6 +8773,9 @@
|
|
|
8734
8773
|
"../src/migrations/1676558804200-task-1074v1.ts",
|
|
8735
8774
|
"../src/migrations/1676656657956-task-1084v1.ts",
|
|
8736
8775
|
"../src/migrations/1677706695399-promote_to_production_2023_01_03.ts",
|
|
8776
|
+
"../src/migrations/1677763068338-task-1032v1.ts",
|
|
8777
|
+
"../src/migrations/1677764464274-task-1032v2.ts",
|
|
8778
|
+
"../src/migrations/1678113864577-task-1098v1.ts",
|
|
8737
8779
|
"../src/migrations/execute/index.ts",
|
|
8738
8780
|
"../src/migrations/index.ts",
|
|
8739
8781
|
"../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.4",
|
|
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.4",
|
|
25
|
+
"@reachu/utils": "1.0.4",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, DeleteDateColumn } from 'typeorm';
|
|
2
|
+
import AuditedModel from './AuditedModel';
|
|
2
3
|
import Category from './Category';
|
|
3
4
|
|
|
4
5
|
@Entity()
|
|
5
|
-
export default class Subcategory {
|
|
6
|
+
export default class Subcategory extends AuditedModel {
|
|
6
7
|
@PrimaryGeneratedColumn()
|
|
7
8
|
id: number;
|
|
8
9
|
|
|
10
|
+
@DeleteDateColumn()
|
|
11
|
+
deletedAt: Date;
|
|
12
|
+
|
|
9
13
|
@Column('varchar')
|
|
10
14
|
name: string;
|
|
11
15
|
|
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
Column,
|
|
7
7
|
ManyToOne,
|
|
8
8
|
JoinColumn,
|
|
9
|
+
OneToMany,
|
|
9
10
|
} from 'typeorm';
|
|
10
11
|
import AuditedModel from '../../AuditedModel';
|
|
11
12
|
import Shipping from './Shipping';
|
|
13
|
+
import CartItem from '../shopcart/CartItem';
|
|
12
14
|
|
|
13
15
|
@Entity()
|
|
14
16
|
export default class ProductShipping extends AuditedModel {
|
|
@@ -34,4 +36,7 @@ export default class ProductShipping extends AuditedModel {
|
|
|
34
36
|
})
|
|
35
37
|
@JoinColumn()
|
|
36
38
|
product: Product;
|
|
39
|
+
|
|
40
|
+
@OneToMany(() => CartItem, (cartItem: CartItem) => cartItem.productShipping, { cascade: true })
|
|
41
|
+
cartItem: CartItem[];
|
|
37
42
|
}
|
|
@@ -11,6 +11,7 @@ import AuditedModel from '../../AuditedModel';
|
|
|
11
11
|
import { PriceData } from './PriceData';
|
|
12
12
|
import Cart from './Cart';
|
|
13
13
|
import { Product } from '../../Product.entity';
|
|
14
|
+
import ProductShipping from '../shipping/ProductShipping';
|
|
14
15
|
|
|
15
16
|
@Entity()
|
|
16
17
|
export default class CartItem extends AuditedModel {
|
|
@@ -37,4 +38,12 @@ export default class CartItem extends AuditedModel {
|
|
|
37
38
|
@ManyToOne(() => Cart, (cart: Cart) => cart.line_items, { eager: true, onDelete: 'CASCADE' })
|
|
38
39
|
@JoinColumn()
|
|
39
40
|
cart: Cart;
|
|
41
|
+
|
|
42
|
+
@ManyToOne(
|
|
43
|
+
() => ProductShipping,
|
|
44
|
+
(productShipping: ProductShipping) => productShipping.cartItem,
|
|
45
|
+
{ eager: true, onDelete: 'CASCADE' },
|
|
46
|
+
)
|
|
47
|
+
@JoinColumn()
|
|
48
|
+
productShipping: ProductShipping;
|
|
40
49
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class task1032V11677763068338 implements MigrationInterface {
|
|
4
|
+
name = 'task1032V11677763068338';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE \`category_images\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`srcn\` varchar(255) NULL, \`slug\` varchar(255) NULL, \`name\` varchar(255) NULL, \`src\` varchar(255) NULL, \`alt\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`CREATE TABLE \`product_attribute\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`attribute_id\` int NULL, \`product_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`CREATE TABLE \`attribute\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`name\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
|
|
15
|
+
);
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`ALTER TABLE \`category\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`,
|
|
18
|
+
);
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE \`category\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE \`category\` ADD \`deleted_at\` datetime(6) NULL`);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE \`category\` ADD \`slug\` varchar(255) NULL`);
|
|
24
|
+
await queryRunner.query(`ALTER TABLE \`category\` ADD \`menu_order\` int NULL`);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE \`category\` ADD \`category_images_id\` int NULL`);
|
|
26
|
+
await queryRunner.query(
|
|
27
|
+
`ALTER TABLE \`category\` ADD CONSTRAINT \`FK_e7068d526cfc9b60374476835ea\` FOREIGN KEY (\`category_images_id\`) REFERENCES \`category_images\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
28
|
+
);
|
|
29
|
+
await queryRunner.query(
|
|
30
|
+
`ALTER TABLE \`product_attribute\` ADD CONSTRAINT \`FK_3e2f6a0f059b619505f30b8e54f\` FOREIGN KEY (\`attribute_id\`) REFERENCES \`attribute\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
31
|
+
);
|
|
32
|
+
await queryRunner.query(
|
|
33
|
+
`ALTER TABLE \`product_attribute\` ADD CONSTRAINT \`FK_c8f119684d209b55cf5e8b42532\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
38
|
+
await queryRunner.query(
|
|
39
|
+
`ALTER TABLE \`product_attribute\` DROP FOREIGN KEY \`FK_c8f119684d209b55cf5e8b42532\``,
|
|
40
|
+
);
|
|
41
|
+
await queryRunner.query(
|
|
42
|
+
`ALTER TABLE \`product_attribute\` DROP FOREIGN KEY \`FK_3e2f6a0f059b619505f30b8e54f\``,
|
|
43
|
+
);
|
|
44
|
+
await queryRunner.query(
|
|
45
|
+
`ALTER TABLE \`category\` DROP FOREIGN KEY \`FK_e7068d526cfc9b60374476835ea\``,
|
|
46
|
+
);
|
|
47
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`category_images_id\``);
|
|
48
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`menu_order\``);
|
|
49
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`slug\``);
|
|
50
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`deleted_at\``);
|
|
51
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`updated_at\``);
|
|
52
|
+
await queryRunner.query(`ALTER TABLE \`category\` DROP COLUMN \`created_at\``);
|
|
53
|
+
await queryRunner.query(`DROP TABLE \`attribute\``);
|
|
54
|
+
await queryRunner.query(`DROP TABLE \`product_attribute\``);
|
|
55
|
+
await queryRunner.query(`DROP TABLE \`category_images\``);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class task1032V21677764464274 implements MigrationInterface {
|
|
4
|
+
name = 'task1032V21677764464274'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` ADD \`deleted_at\` datetime(6) NULL`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` DROP COLUMN \`deleted_at\``);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` DROP COLUMN \`updated_at\``);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`subcategory\` DROP COLUMN \`created_at\``);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class task1098V11678113864577 implements MigrationInterface {
|
|
4
|
+
name = 'task1098V11678113864577'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`product_shipping_id\` varchar(36) NULL`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_2b97b975f9f05cdc297f89d1287\` FOREIGN KEY (\`product_shipping_id\`) REFERENCES \`product_shipping\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_2b97b975f9f05cdc297f89d1287\``);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`product_shipping_id\``);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|