@reachu/database 1.0.175 → 1.0.176
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/ProductScraping.d.ts +2 -1
- package/dist/entity/ProductScraping.js +5 -1
- package/dist/entity/ProductScraping.js.map +1 -1
- package/dist/migrations/1714443774788-product_scraping.d.ts +6 -0
- package/dist/migrations/1714443774788-product_scraping.js +33 -0
- package/dist/migrations/1714443774788-product_scraping.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +14 -2
- package/package.json +3 -3
- package/src/entity/ProductScraping.ts +4 -1
- package/src/migrations/1714443774788-product_scraping.ts +18 -0
|
@@ -28,7 +28,7 @@ __decorate([
|
|
|
28
28
|
__decorate([
|
|
29
29
|
typeorm_1.Column('varchar'),
|
|
30
30
|
__metadata("design:type", String)
|
|
31
|
-
], ProductScraping.prototype, "
|
|
31
|
+
], ProductScraping.prototype, "urls", void 0);
|
|
32
32
|
__decorate([
|
|
33
33
|
typeorm_1.Column('varchar'),
|
|
34
34
|
__metadata("design:type", String)
|
|
@@ -37,6 +37,10 @@ __decorate([
|
|
|
37
37
|
typeorm_1.Column('varchar', { length: '21844', nullable: true }),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
39
|
], ProductScraping.prototype, "properties", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
typeorm_1.Column('varchar', { length: '21844', nullable: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ProductScraping.prototype, "scraper", void 0);
|
|
40
44
|
__decorate([
|
|
41
45
|
typeorm_1.ManyToOne(() => User_1.default, { eager: true }),
|
|
42
46
|
typeorm_1.JoinColumn(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductScraping.js","sourceRoot":"","sources":["../../src/entity/ProductScraping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAOiB;AACjB,kDAA0B;AAC1B,kEAA0C;AAG1C,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;
|
|
1
|
+
{"version":3,"file":"ProductScraping.js","sourceRoot":"","sources":["../../src/entity/ProductScraping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAOiB;AACjB,kDAA0B;AAC1B,kEAA0C;AAG1C,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;CAsBxD,CAAA;AApBC;IADC,gCAAsB,EAAE;;2CACd;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;kDAAC;AAGhB;IADC,gBAAM,CAAC,SAAS,CAAC;;6CACL;AAGb;IADC,gBAAM,CAAC,SAAS,CAAC;;+CACH;AAGf;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACpC;AAGnB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACvC;AAIhB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,oBAAU,EAAE;8BACP,cAAI;6CAAC;AArBQ,eAAe;IADnC,gBAAM,EAAE;GACY,eAAe,CAsBnC;kBAtBoB,eAAe"}
|
|
@@ -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.productScraping1714443774788 = void 0;
|
|
13
|
+
class productScraping1714443774788 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'productScraping1714443774788';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`CREATE TABLE \`product_scraping\` (\`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, \`url\` varchar(255) NOT NULL, \`status\` varchar(255) NOT NULL, \`properties\` varchar(21844) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`product\` ADD \`origin_url\` varchar(255) NULL`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`product_scraping\` ADD CONSTRAINT \`FK_e8c2061ff40e510e6fb8e89a184\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
down(queryRunner) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`product_scraping\` DROP FOREIGN KEY \`FK_e8c2061ff40e510e6fb8e89a184\``);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`origin_url\``);
|
|
28
|
+
yield queryRunner.query(`DROP TABLE \`product_scraping\``);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.productScraping1714443774788 = productScraping1714443774788;
|
|
33
|
+
//# sourceMappingURL=1714443774788-product_scraping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1714443774788-product_scraping.js","sourceRoot":"","sources":["../../src/migrations/1714443774788-product_scraping.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,4BAA4B;IAAzC;QACI,SAAI,GAAG,8BAA8B,CAAA;IAczC,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,2aAA2a,CAAC,CAAC;YACrc,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;YACxF,MAAM,WAAW,CAAC,KAAK,CAAC,kLAAkL,CAAC,CAAC;QAChN,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;YAC9E,MAAM,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAC/D,CAAC;KAAA;CAEJ;AAfD,oEAeC"}
|
|
@@ -2797,8 +2797,8 @@
|
|
|
2797
2797
|
"affectsGlobalScope": false
|
|
2798
2798
|
},
|
|
2799
2799
|
"../src/entity/productscraping.ts": {
|
|
2800
|
-
"version": "
|
|
2801
|
-
"signature": "
|
|
2800
|
+
"version": "99f4a1ac5703af82798097d2bbe5fc8e48ef86795d20eb89a8bf74e6413b972d",
|
|
2801
|
+
"signature": "a74ca82c5eda95c66ac02acdfde265581be12d96723d167e315518d8c76df6ac",
|
|
2802
2802
|
"affectsGlobalScope": false
|
|
2803
2803
|
},
|
|
2804
2804
|
"../src/entity/index.ts": {
|
|
@@ -3776,6 +3776,11 @@
|
|
|
3776
3776
|
"signature": "c433b31f1ee5b88a418ea3c3e5ca6bc91c99027c13f8c2c5407acd0159357d9c",
|
|
3777
3777
|
"affectsGlobalScope": false
|
|
3778
3778
|
},
|
|
3779
|
+
"../src/migrations/1714443774788-product_scraping.ts": {
|
|
3780
|
+
"version": "a2f05c46e6e107461dd66963417c341ef93e884d971366d0d9f3d089fc91f10a",
|
|
3781
|
+
"signature": "1e846637f4ec9fefa58c3206b0469c64235194c563e3feb852cc49f2499ce9e5",
|
|
3782
|
+
"affectsGlobalScope": false
|
|
3783
|
+
},
|
|
3779
3784
|
"../src/migrations/execute/index.ts": {
|
|
3780
3785
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3781
3786
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -6963,6 +6968,9 @@
|
|
|
6963
6968
|
"../src/migrations/1714169905823-cart-channel-user.ts": [
|
|
6964
6969
|
"../node_modules/typeorm/index.d.ts"
|
|
6965
6970
|
],
|
|
6971
|
+
"../src/migrations/1714443774788-product_scraping.ts": [
|
|
6972
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6973
|
+
],
|
|
6966
6974
|
"../src/migrations/execute/index.ts": [
|
|
6967
6975
|
"../src/config/connect.ts"
|
|
6968
6976
|
],
|
|
@@ -10002,6 +10010,9 @@
|
|
|
10002
10010
|
"../src/migrations/1714169905823-cart-channel-user.ts": [
|
|
10003
10011
|
"../node_modules/typeorm/index.d.ts"
|
|
10004
10012
|
],
|
|
10013
|
+
"../src/migrations/1714443774788-product_scraping.ts": [
|
|
10014
|
+
"../node_modules/typeorm/index.d.ts"
|
|
10015
|
+
],
|
|
10005
10016
|
"../src/migrations/index.ts": [
|
|
10006
10017
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
10007
10018
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -10920,6 +10931,7 @@
|
|
|
10920
10931
|
"../src/migrations/1713881510590-checkout-buyer-accepts.ts",
|
|
10921
10932
|
"../src/migrations/1714142019591-order-confirmation-email.ts",
|
|
10922
10933
|
"../src/migrations/1714169905823-cart-channel-user.ts",
|
|
10934
|
+
"../src/migrations/1714443774788-product_scraping.ts",
|
|
10923
10935
|
"../src/migrations/execute/index.ts",
|
|
10924
10936
|
"../src/migrations/index.ts",
|
|
10925
10937
|
"../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.176",
|
|
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.176",
|
|
25
|
+
"@reachu/utils": "1.0.176",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -18,7 +18,7 @@ export default class ProductScraping extends AuditedModel {
|
|
|
18
18
|
deletedAt: Date;
|
|
19
19
|
|
|
20
20
|
@Column('varchar')
|
|
21
|
-
|
|
21
|
+
urls: string;
|
|
22
22
|
|
|
23
23
|
@Column('varchar')
|
|
24
24
|
status: string;
|
|
@@ -26,6 +26,9 @@ export default class ProductScraping extends AuditedModel {
|
|
|
26
26
|
@Column('varchar', { length: '21844', nullable: true })
|
|
27
27
|
properties: string;
|
|
28
28
|
|
|
29
|
+
@Column('varchar', { length: '21844', nullable: true })
|
|
30
|
+
scraper: string;
|
|
31
|
+
|
|
29
32
|
@ManyToOne(() => User, { eager: true })
|
|
30
33
|
@JoinColumn()
|
|
31
34
|
user: User;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class productScraping1714443774788 implements MigrationInterface {
|
|
4
|
+
name = 'productScraping1714443774788'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE \`product_scraping\` (\`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, \`url\` varchar(255) NOT NULL, \`status\` varchar(255) NOT NULL, \`properties\` varchar(21844) NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD \`origin_url\` varchar(255) NULL`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`product_scraping\` ADD CONSTRAINT \`FK_e8c2061ff40e510e6fb8e89a184\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`product_scraping\` DROP FOREIGN KEY \`FK_e8c2061ff40e510e6fb8e89a184\``);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`origin_url\``);
|
|
15
|
+
await queryRunner.query(`DROP TABLE \`product_scraping\``);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|