@reachu/database 1.0.99 → 1.0.101

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.
Files changed (45) hide show
  1. package/dist/entity/ChannelUser.d.ts +2 -0
  2. package/dist/entity/ChannelUser.js +14 -2
  3. package/dist/entity/ChannelUser.js.map +1 -1
  4. package/dist/entity/WooConnection.js +1 -1
  5. package/dist/entity/WooConnection.js.map +1 -1
  6. package/dist/migrations/1689345976870-promote_to_development_14_07_23.d.ts +6 -0
  7. package/dist/migrations/1689345976870-promote_to_development_14_07_23.js +47 -0
  8. package/dist/migrations/1689345976870-promote_to_development_14_07_23.js.map +1 -0
  9. package/dist/migrations/1689964936496-promote_to_production_21_07_23_01.d.ts +6 -0
  10. package/dist/migrations/1689964936496-promote_to_production_21_07_23_01.js +93 -0
  11. package/dist/migrations/1689964936496-promote_to_production_21_07_23_01.js.map +1 -0
  12. package/dist/migrations/1691662129283-woo_connect_channel_user.d.ts +6 -0
  13. package/dist/migrations/1691662129283-woo_connect_channel_user.js +31 -0
  14. package/dist/migrations/1691662129283-woo_connect_channel_user.js.map +1 -0
  15. package/dist/migrations/1691670038774-woo_connect_channel_user_1.d.ts +6 -0
  16. package/dist/migrations/1691670038774-woo_connect_channel_user_1.js +33 -0
  17. package/dist/migrations/1691670038774-woo_connect_channel_user_1.js.map +1 -0
  18. package/dist/migrations/1691670866271-woo_connect_channel_user_3.d.ts +6 -0
  19. package/dist/migrations/1691670866271-woo_connect_channel_user_3.js +35 -0
  20. package/dist/migrations/1691670866271-woo_connect_channel_user_3.js.map +1 -0
  21. package/dist/migrations/1691671305372-woo_connect_channel_user_4.d.ts +6 -0
  22. package/dist/migrations/1691671305372-woo_connect_channel_user_4.js +31 -0
  23. package/dist/migrations/1691671305372-woo_connect_channel_user_4.js.map +1 -0
  24. package/dist/migrations/1691671493692-woo_connect_channel_user_5.d.ts +6 -0
  25. package/dist/migrations/1691671493692-woo_connect_channel_user_5.js +29 -0
  26. package/dist/migrations/1691671493692-woo_connect_channel_user_5.js.map +1 -0
  27. package/dist/migrations/1691679304105-woo_connect_channel_user_6.d.ts +6 -0
  28. package/dist/migrations/1691679304105-woo_connect_channel_user_6.js +31 -0
  29. package/dist/migrations/1691679304105-woo_connect_channel_user_6.js.map +1 -0
  30. package/dist/migrations/1691764260299-promote_to_production_11_08_23.d.ts +6 -0
  31. package/dist/migrations/1691764260299-promote_to_production_11_08_23.js +33 -0
  32. package/dist/migrations/1691764260299-promote_to_production_11_08_23.js.map +1 -0
  33. package/dist/tsconfig.tsbuildinfo +115 -5
  34. package/package.json +3 -3
  35. package/src/entity/ChannelUser.ts +13 -3
  36. package/src/entity/WooConnection.ts +2 -2
  37. package/src/migrations/1689345976870-promote_to_development_14_07_23.ts +32 -0
  38. package/src/migrations/1689964936496-promote_to_production_21_07_23_01.ts +78 -0
  39. package/src/migrations/1691662129283-woo_connect_channel_user.ts +16 -0
  40. package/src/migrations/1691670038774-woo_connect_channel_user_1.ts +18 -0
  41. package/src/migrations/1691670866271-woo_connect_channel_user_3.ts +20 -0
  42. package/src/migrations/1691671305372-woo_connect_channel_user_4.ts +16 -0
  43. package/src/migrations/1691671493692-woo_connect_channel_user_5.ts +14 -0
  44. package/src/migrations/1691679304105-woo_connect_channel_user_6.ts +16 -0
  45. package/src/migrations/1691764260299-promote_to_production_11_08_23.ts +18 -0
@@ -4,6 +4,7 @@ import ChannelGroup from './ChannelGroup';
4
4
  import ChannelUserProductSync from './ChannelUserProductSync';
5
5
  import User from './User';
6
6
  import ShopifyConnection from './ShopifyConnection';
7
+ import WooConnection from './WooConnection';
7
8
  import UserChannelApiKey from './UserChannelApiKey';
8
9
  export default class ChannelUser extends AuditedModel {
9
10
  deletedAt: Date;
@@ -14,5 +15,6 @@ export default class ChannelUser extends AuditedModel {
14
15
  channelGroup: ChannelGroup[];
15
16
  channelUserProductSync: ChannelUserProductSync[];
16
17
  shopifyConnection: ShopifyConnection;
18
+ wooConnection: WooConnection;
17
19
  userChannelApiKey: UserChannelApiKey;
18
20
  }
@@ -19,6 +19,7 @@ const ChannelGroup_1 = __importDefault(require("./ChannelGroup"));
19
19
  const ChannelUserProductSync_1 = __importDefault(require("./ChannelUserProductSync"));
20
20
  const User_1 = __importDefault(require("./User"));
21
21
  const ShopifyConnection_1 = __importDefault(require("./ShopifyConnection"));
22
+ const WooConnection_1 = __importDefault(require("./WooConnection"));
22
23
  const UserChannelApiKey_1 = __importDefault(require("./UserChannelApiKey"));
23
24
  let ChannelUser = class ChannelUser extends AuditedModel_1.default {
24
25
  };
@@ -59,12 +60,23 @@ __decorate([
59
60
  __metadata("design:type", Array)
60
61
  ], ChannelUser.prototype, "channelUserProductSync", void 0);
61
62
  __decorate([
62
- typeorm_1.ManyToOne(() => ShopifyConnection_1.default, (shopifyConnection) => shopifyConnection.id, { nullable: true }),
63
+ typeorm_1.ManyToOne(() => ShopifyConnection_1.default, (shopifyConnection) => shopifyConnection.id, {
64
+ nullable: true,
65
+ }),
63
66
  typeorm_1.JoinColumn(),
64
67
  __metadata("design:type", ShopifyConnection_1.default)
65
68
  ], ChannelUser.prototype, "shopifyConnection", void 0);
66
69
  __decorate([
67
- typeorm_1.ManyToOne(() => UserChannelApiKey_1.default, (userChannelApiKey) => userChannelApiKey.id, { nullable: true }),
70
+ typeorm_1.ManyToOne(() => WooConnection_1.default, (wooConnection) => wooConnection.id, {
71
+ nullable: true,
72
+ }),
73
+ typeorm_1.JoinColumn(),
74
+ __metadata("design:type", WooConnection_1.default)
75
+ ], ChannelUser.prototype, "wooConnection", void 0);
76
+ __decorate([
77
+ typeorm_1.ManyToOne(() => UserChannelApiKey_1.default, (userChannelApiKey) => userChannelApiKey.id, {
78
+ nullable: true,
79
+ }),
68
80
  typeorm_1.JoinColumn(),
69
81
  __metadata("design:type", UserChannelApiKey_1.default)
70
82
  ], ChannelUser.prototype, "userChannelApiKey", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelUser.js","sourceRoot":"","sources":["../../src/entity/ChannelUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,kEAA0C;AAC1C,wDAAgC;AAChC,kEAA0C;AAC1C,sFAA8D;AAC9D,kDAA0B;AAC1B,4EAAoD;AACpD,4EAAoD;AAGpD,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,sBAAY;CA2CpD,CAAA;AAzCC;IADC,0BAAgB,EAAE;8BACR,IAAI;8CAAC;AAGhB;IADC,gCAAsB,EAAE;;uCACd;AAGX;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACnB;AAInB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjE,oBAAU,EAAE;8BACP,cAAI;yCAAC;AAIX;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,iBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACnF,oBAAU,EAAE;8BACJ,iBAAO;4CAAC;AAMjB;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,sBAAY,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE;QACvF,OAAO,EAAE,IAAI;KACd,CAAC;IACD,oBAAU,EAAE;;iDACgB;AAU7B;IARC,mBAAS,CACR,GAAG,EAAE,CAAC,gCAAsB,EAC5B,CAAC,sBAA8C,EAAE,EAAE,CAAC,sBAAsB,CAAC,WAAW,EACtF;QACE,OAAO,EAAE,IAAI;KACd,CACF;IACA,oBAAU,EAAE;;2DACoC;AAIjD;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,2BAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnG,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAKrC;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,2BAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnG,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAzClB,WAAW;IAD/B,gBAAM,EAAE;GACY,WAAW,CA2C/B;kBA3CoB,WAAW"}
1
+ {"version":3,"file":"ChannelUser.js","sourceRoot":"","sources":["../../src/entity/ChannelUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,kEAA0C;AAC1C,wDAAgC;AAChC,kEAA0C;AAC1C,sFAA8D;AAC9D,kDAA0B;AAC1B,4EAAoD;AACpD,oEAA4C;AAE5C,4EAAoD;AAGpD,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,sBAAY;CAmDpD,CAAA;AAjDC;IADC,0BAAgB,EAAE;8BACR,IAAI;8CAAC;AAGhB;IADC,gCAAsB,EAAE;;uCACd;AAGX;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACnB;AAInB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjE,oBAAU,EAAE;8BACP,cAAI;yCAAC;AAIX;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,iBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACnF,oBAAU,EAAE;8BACJ,iBAAO;4CAAC;AAMjB;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,sBAAY,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE;QACvF,OAAO,EAAE,IAAI;KACd,CAAC;IACD,oBAAU,EAAE;;iDACgB;AAU7B;IARC,mBAAS,CACR,GAAG,EAAE,CAAC,gCAAsB,EAC5B,CAAC,sBAA8C,EAAE,EAAE,CAAC,sBAAsB,CAAC,WAAW,EACtF;QACE,OAAO,EAAE,IAAI;KACd,CACF;IACA,oBAAU,EAAE;;2DACoC;AAMjD;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,2BAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE;QAC/E,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAMrC;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,uBAAa,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;QACnE,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACE,uBAAa;kDAAC;AAM7B;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,2BAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE;QAC/E,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAlDlB,WAAW;IAD/B,gBAAM,EAAE;GACY,WAAW,CAmD/B;kBAnDoB,WAAW"}
@@ -37,7 +37,7 @@ __decorate([
37
37
  __metadata("design:type", String)
38
38
  ], WooConnection.prototype, "currency", void 0);
39
39
  __decorate([
40
- typeorm_1.OneToOne(() => User_1.default, (user) => user.woo, { onDelete: 'CASCADE' }),
40
+ typeorm_1.ManyToOne(() => User_1.default, (user) => user.woo, { onDelete: 'CASCADE' }),
41
41
  typeorm_1.JoinColumn(),
42
42
  __metadata("design:type", User_1.default)
43
43
  ], WooConnection.prototype, "user", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"WooConnection.js","sourceRoot":"","sources":["../../src/entity/WooConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAuF;AACvF,kDAA0B;AAG1B,IAAqB,aAAa,GAAlC,MAAqB,aAAa;CAmBjC,CAAA;AAjBC;IADC,gCAAsB,EAAE;;yCACd;AAGX;IADC,gBAAM,CAAC,SAAS,CAAC;;2CACL;AAGb;IADC,gBAAM,CAAC,SAAS,CAAC;;kDACE;AAGpB;IADC,gBAAM,CAAC,SAAS,CAAC;;qDACK;AAGvB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACpB;AAIlB;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjE,oBAAU,EAAE;8BACP,cAAI;2CAAC;AAlBQ,aAAa;IADjC,gBAAM,EAAE;GACY,aAAa,CAmBjC;kBAnBoB,aAAa"}
1
+ {"version":3,"file":"WooConnection.js","sourceRoot":"","sources":["../../src/entity/WooConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kDAA0B;AAG1B,IAAqB,aAAa,GAAlC,MAAqB,aAAa;CAmBjC,CAAA;AAjBC;IADC,gCAAsB,EAAE;;yCACd;AAGX;IADC,gBAAM,CAAC,SAAS,CAAC;;2CACL;AAGb;IADC,gBAAM,CAAC,SAAS,CAAC;;kDACE;AAGpB;IADC,gBAAM,CAAC,SAAS,CAAC;;qDACK;AAGvB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACpB;AAIlB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAClE,oBAAU,EAAE;8BACP,cAAI;2CAAC;AAlBQ,aAAa;IADjC,gBAAM,EAAE;GACY,aAAa,CAmBjC;kBAnBoB,aAAa"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class promoteToDevelopment1407231689345976870 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,47 @@
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.promoteToDevelopment1407231689345976870 = void 0;
13
+ class promoteToDevelopment1407231689345976870 {
14
+ constructor() {
15
+ this.name = 'promoteToDevelopment1407231689345976870';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`DROP INDEX \`FK_adc2206f21efb67f9f6425a4ce8\` ON \`user_channel_api_key\``);
20
+ yield queryRunner.query(`ALTER TABLE \`variant\` DROP COLUMN \`active\``);
21
+ yield queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP COLUMN \`channel_user_id\``);
22
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`shopify_connection_id\` int NULL`);
23
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`user_channel_api_key_id\` int NULL`);
24
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` ADD \`channel_user_id\` int NULL`);
25
+ yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
26
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_687a267ae83f576c002baf0198a\` FOREIGN KEY (\`shopify_connection_id\`) REFERENCES \`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
27
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_83f345b5912388def4fa4253040\` FOREIGN KEY (\`user_channel_api_key_id\`) REFERENCES \`user_channel_api_key\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
28
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` ADD CONSTRAINT \`FK_f8bdfc8b3e1fdf9e96a351d73e2\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
29
+ });
30
+ }
31
+ down(queryRunner) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` DROP FOREIGN KEY \`FK_f8bdfc8b3e1fdf9e96a351d73e2\``);
34
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_83f345b5912388def4fa4253040\``);
35
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_687a267ae83f576c002baf0198a\``);
36
+ yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
37
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` DROP COLUMN \`channel_user_id\``);
38
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`user_channel_api_key_id\``);
39
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`shopify_connection_id\``);
40
+ yield queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD \`channel_user_id\` int NULL`);
41
+ yield queryRunner.query(`ALTER TABLE \`variant\` ADD \`active\` tinyint NOT NULL DEFAULT '1'`);
42
+ yield queryRunner.query(`CREATE INDEX \`FK_adc2206f21efb67f9f6425a4ce8\` ON \`user_channel_api_key\` (\`channel_user_id\`)`);
43
+ });
44
+ }
45
+ }
46
+ exports.promoteToDevelopment1407231689345976870 = promoteToDevelopment1407231689345976870;
47
+ //# sourceMappingURL=1689345976870-promote_to_development_14_07_23.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1689345976870-promote_to_development_14_07_23.js","sourceRoot":"","sources":["../../src/migrations/1689345976870-promote_to_development_14_07_23.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,uCAAuC;IAApD;QACI,SAAI,GAAG,yCAAyC,CAAA;IA4BpD,CAAC;IA1BgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,2EAA2E,CAAC,CAAC;YACrG,MAAM,WAAW,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAC1E,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAChG,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YACjG,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,sLAAsL,CAAC,CAAC;YAChN,MAAM,WAAW,CAAC,KAAK,CAAC,0MAA0M,CAAC,CAAC;YACpO,MAAM,WAAW,CAAC,KAAK,CAAC,8MAA8M,CAAC,CAAC;YACxO,MAAM,WAAW,CAAC,KAAK,CAAC,kMAAkM,CAAC,CAAC;QAChO,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;YAClH,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAChG,MAAM,WAAW,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;YAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YACjG,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,mGAAmG,CAAC,CAAC;QACjI,CAAC;KAAA;CAEJ;AA7BD,0FA6BC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class promoteToProduction210723011689964936496 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,93 @@
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.promoteToProduction210723011689964936496 = void 0;
13
+ class promoteToProduction210723011689964936496 {
14
+ constructor() {
15
+ this.name = 'promoteToProduction210723011689964936496';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE \`webhook_template_ecommerce\` (\`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, \`connection\` tinyint NOT NULL DEFAULT 0, \`response\` varchar(21844) NULL, \`type\` varchar(255) NULL, \`url_params\` varchar(255) NULL, \`body\` varchar(21844) NULL, \`title\` varchar(255) NOT NULL, \`user_template_ecommerce_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
20
+ yield queryRunner.query(`CREATE TABLE \`discount_type\` (\`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, \`type\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
21
+ yield queryRunner.query(`CREATE TABLE \`discount_product\` (\`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, \`product_id\` int NOT NULL, \`discount_id\` int NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
22
+ yield queryRunner.query(`CREATE TABLE \`discount_cart\` (\`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, \`applied\` tinyint NOT NULL DEFAULT 0, \`discount_id\` int NOT NULL, \`cart_id\` varchar(36) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
23
+ yield queryRunner.query(`CREATE TABLE \`discount\` (\`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, \`discount_count\` int NULL, \`code\` varchar(255) NOT NULL, \`percentage\` int NOT NULL, \`start_date\` datetime NOT NULL, \`end_date\` datetime NOT NULL, \`discount_type_id\` int NOT NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
24
+ yield queryRunner.query(`ALTER TABLE \`variant\` ADD \`active\` tinyint NOT NULL DEFAULT 1`);
25
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`custom_name\` varchar(255) NULL`);
26
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`shopify_connection_id\` int NULL`);
27
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`user_channel_api_key_id\` int NULL`);
28
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` ADD \`channel_user_id\` int NULL`);
29
+ yield queryRunner.query(`ALTER TABLE \`cart\` ADD \`shipping_country\` varchar(255) NULL`);
30
+ yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`shipping_country_id\` varchar(36) NULL`);
31
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`type\` varchar(255) NULL`);
32
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`body\` varchar(21844) NULL`);
33
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`title\` varchar(255) NOT NULL`);
34
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_one_token_key\` varchar(255) NULL`);
35
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_one_token_secret\` varchar(255) NULL`);
36
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_id\` varchar(255) NULL`);
37
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_secret\` varchar(255) NULL`);
38
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_endpoint\` varchar(255) NULL`);
39
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_audience\` varchar(255) NULL`);
40
+ yield queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
41
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_687a267ae83f576c002baf0198a\` FOREIGN KEY (\`shopify_connection_id\`) REFERENCES \`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
42
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_83f345b5912388def4fa4253040\` FOREIGN KEY (\`user_channel_api_key_id\`) REFERENCES \`user_channel_api_key\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
43
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` ADD CONSTRAINT \`FK_f8bdfc8b3e1fdf9e96a351d73e2\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
44
+ yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_3bc8725061c3cea8a94060bfc9d\` FOREIGN KEY (\`shipping_country_id\`) REFERENCES \`shipping_country\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
45
+ yield queryRunner.query(`ALTER TABLE \`webhook_template_ecommerce\` ADD CONSTRAINT \`FK_b05fbf9109c855ceedd94df1b09\` FOREIGN KEY (\`user_template_ecommerce_id\`) REFERENCES \`user_template_ecommerce\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
46
+ yield queryRunner.query(`ALTER TABLE \`discount_product\` ADD CONSTRAINT \`FK_6939b3f91b1db4d133d20c33e3b\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
47
+ yield queryRunner.query(`ALTER TABLE \`discount_product\` ADD CONSTRAINT \`FK_6cfb1683e023b96a42f7e72edd6\` FOREIGN KEY (\`discount_id\`) REFERENCES \`discount\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
48
+ yield queryRunner.query(`ALTER TABLE \`discount_cart\` ADD CONSTRAINT \`FK_ff034b5de6a90766ce209ae92a4\` FOREIGN KEY (\`discount_id\`) REFERENCES \`discount\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
49
+ yield queryRunner.query(`ALTER TABLE \`discount_cart\` ADD CONSTRAINT \`FK_42951860fa261b863933523298e\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
50
+ yield queryRunner.query(`ALTER TABLE \`discount\` ADD CONSTRAINT \`FK_40b4ec0b1661fe175e00646f507\` FOREIGN KEY (\`discount_type_id\`) REFERENCES \`discount_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
51
+ yield queryRunner.query(`ALTER TABLE \`discount\` ADD CONSTRAINT \`FK_494f73684a24415ee7becc8cb6a\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
52
+ });
53
+ }
54
+ down(queryRunner) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ yield queryRunner.query(`ALTER TABLE \`discount\` DROP FOREIGN KEY \`FK_494f73684a24415ee7becc8cb6a\``);
57
+ yield queryRunner.query(`ALTER TABLE \`discount\` DROP FOREIGN KEY \`FK_40b4ec0b1661fe175e00646f507\``);
58
+ yield queryRunner.query(`ALTER TABLE \`discount_cart\` DROP FOREIGN KEY \`FK_42951860fa261b863933523298e\``);
59
+ yield queryRunner.query(`ALTER TABLE \`discount_cart\` DROP FOREIGN KEY \`FK_ff034b5de6a90766ce209ae92a4\``);
60
+ yield queryRunner.query(`ALTER TABLE \`discount_product\` DROP FOREIGN KEY \`FK_6cfb1683e023b96a42f7e72edd6\``);
61
+ yield queryRunner.query(`ALTER TABLE \`discount_product\` DROP FOREIGN KEY \`FK_6939b3f91b1db4d133d20c33e3b\``);
62
+ yield queryRunner.query(`ALTER TABLE \`webhook_template_ecommerce\` DROP FOREIGN KEY \`FK_b05fbf9109c855ceedd94df1b09\``);
63
+ yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_3bc8725061c3cea8a94060bfc9d\``);
64
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` DROP FOREIGN KEY \`FK_f8bdfc8b3e1fdf9e96a351d73e2\``);
65
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_83f345b5912388def4fa4253040\``);
66
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_687a267ae83f576c002baf0198a\``);
67
+ yield queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
68
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_audience\``);
69
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_endpoint\``);
70
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_secret\``);
71
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_id\``);
72
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_one_token_secret\``);
73
+ yield queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_one_token_key\``);
74
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`title\``);
75
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`body\``);
76
+ yield queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`type\``);
77
+ yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`shipping_country_id\``);
78
+ yield queryRunner.query(`ALTER TABLE \`cart\` DROP COLUMN \`shipping_country\``);
79
+ yield queryRunner.query(`ALTER TABLE \`imported_product\` DROP COLUMN \`channel_user_id\``);
80
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`user_channel_api_key_id\``);
81
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`shopify_connection_id\``);
82
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`custom_name\``);
83
+ yield queryRunner.query(`ALTER TABLE \`variant\` DROP COLUMN \`active\``);
84
+ yield queryRunner.query(`DROP TABLE \`discount\``);
85
+ yield queryRunner.query(`DROP TABLE \`discount_cart\``);
86
+ yield queryRunner.query(`DROP TABLE \`discount_product\``);
87
+ yield queryRunner.query(`DROP TABLE \`discount_type\``);
88
+ yield queryRunner.query(`DROP TABLE \`webhook_template_ecommerce\``);
89
+ });
90
+ }
91
+ }
92
+ exports.promoteToProduction210723011689964936496 = promoteToProduction210723011689964936496;
93
+ //# sourceMappingURL=1689964936496-promote_to_production_21_07_23_01.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1689964936496-promote_to_production_21_07_23_01.js","sourceRoot":"","sources":["../../src/migrations/1689964936496-promote_to_production_21_07_23_01.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,wCAAwC;IAArD;QACI,SAAI,GAAG,0CAA0C,CAAA;IA0ErD,CAAC;IAxEgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,4kBAA4kB,CAAC,CAAC;YACtmB,MAAM,WAAW,CAAC,KAAK,CAAC,6UAA6U,CAAC,CAAC;YACvW,MAAM,WAAW,CAAC,KAAK,CAAC,2WAA2W,CAAC,CAAC;YACrY,MAAM,WAAW,CAAC,KAAK,CAAC,qZAAqZ,CAAC,CAAC;YAC/a,MAAM,WAAW,CAAC,KAAK,CAAC,6fAA6f,CAAC,CAAC;YACvhB,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;YAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YACjG,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;YAC3F,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,4EAA4E,CAAC,CAAC;YACtG,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YACxG,MAAM,WAAW,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;YAC3G,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,4EAA4E,CAAC,CAAC;YACtG,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YACnG,MAAM,WAAW,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;YACvG,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,sLAAsL,CAAC,CAAC;YAChN,MAAM,WAAW,CAAC,KAAK,CAAC,0MAA0M,CAAC,CAAC;YACpO,MAAM,WAAW,CAAC,KAAK,CAAC,8MAA8M,CAAC,CAAC;YACxO,MAAM,WAAW,CAAC,KAAK,CAAC,kMAAkM,CAAC,CAAC;YAC5N,MAAM,WAAW,CAAC,KAAK,CAAC,iMAAiM,CAAC,CAAC;YAC3N,MAAM,WAAW,CAAC,KAAK,CAAC,gOAAgO,CAAC,CAAC;YAC1P,MAAM,WAAW,CAAC,KAAK,CAAC,wLAAwL,CAAC,CAAC;YAClN,MAAM,WAAW,CAAC,KAAK,CAAC,0LAA0L,CAAC,CAAC;YACpN,MAAM,WAAW,CAAC,KAAK,CAAC,uLAAuL,CAAC,CAAC;YACjN,MAAM,WAAW,CAAC,KAAK,CAAC,+KAA+K,CAAC,CAAC;YACzM,MAAM,WAAW,CAAC,KAAK,CAAC,0LAA0L,CAAC,CAAC;YACpN,MAAM,WAAW,CAAC,KAAK,CAAC,0KAA0K,CAAC,CAAC;QACxM,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YACxG,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YACxG,MAAM,WAAW,CAAC,KAAK,CAAC,mFAAmF,CAAC,CAAC;YAC7G,MAAM,WAAW,CAAC,KAAK,CAAC,mFAAmF,CAAC,CAAC;YAC7G,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,gGAAgG,CAAC,CAAC;YAC1H,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;YAClH,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;YACjF,MAAM,WAAW,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC5F,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;YAChG,MAAM,WAAW,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;YAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;YACpF,MAAM,WAAW,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAC1E,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YACnD,MAAM,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;YACxD,MAAM,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YAC3D,MAAM,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;YACxD,MAAM,WAAW,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACzE,CAAC;KAAA;CAEJ;AA3ED,4FA2EC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser1691662129283 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.wooConnectChannelUser1691662129283 = void 0;
13
+ class wooConnectChannelUser1691662129283 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser1691662129283';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`woo_connection_id\` int NULL`);
20
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_fff56e95cc26550a1c6ae8f1863\` FOREIGN KEY (\`woo_connection_id\`) REFERENCES \`woo_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
21
+ });
22
+ }
23
+ down(queryRunner) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_fff56e95cc26550a1c6ae8f1863\``);
26
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`woo_connection_id\``);
27
+ });
28
+ }
29
+ }
30
+ exports.wooConnectChannelUser1691662129283 = wooConnectChannelUser1691662129283;
31
+ //# sourceMappingURL=1691662129283-woo_connect_channel_user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691662129283-woo_connect_channel_user.js","sourceRoot":"","sources":["../../src/migrations/1691662129283-woo_connect_channel_user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,kCAAkC;IAA/C;QACI,SAAI,GAAG,oCAAoC,CAAA;IAY/C,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;YAC3F,MAAM,WAAW,CAAC,KAAK,CAAC,kMAAkM,CAAC,CAAC;QAChO,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;QAC9F,CAAC;KAAA;CAEJ;AAbD,gFAaC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser11691670038774 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.wooConnectChannelUser11691670038774 = void 0;
13
+ class wooConnectChannelUser11691670038774 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser11691670038774';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
20
+ yield queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
21
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
22
+ });
23
+ }
24
+ down(queryRunner) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
27
+ yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
28
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
29
+ });
30
+ }
31
+ }
32
+ exports.wooConnectChannelUser11691670038774 = wooConnectChannelUser11691670038774;
33
+ //# sourceMappingURL=1691670038774-woo_connect_channel_user_1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691670038774-woo_connect_channel_user_1.js","sourceRoot":"","sources":["../../src/migrations/1691670038774-woo_connect_channel_user_1.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,mCAAmC;IAAhD;QACI,SAAI,GAAG,qCAAqC,CAAA;IAchD,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC9G,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACtF,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;YACnF,MAAM,WAAW,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAC;YACtH,MAAM,WAAW,CAAC,KAAK,CAAC,8KAA8K,CAAC,CAAC;QAC5M,CAAC;KAAA;CAEJ;AAfD,kFAeC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser31691670866271 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.wooConnectChannelUser31691670866271 = void 0;
13
+ class wooConnectChannelUser31691670866271 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser31691670866271';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
20
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD UNIQUE INDEX \`IDX_c61b68995acf5a1a32f2c60175\` (\`user_id\`)`);
21
+ yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
22
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
23
+ });
24
+ }
25
+ down(queryRunner) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
28
+ yield queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
29
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP INDEX \`IDX_c61b68995acf5a1a32f2c60175\``);
30
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
31
+ });
32
+ }
33
+ }
34
+ exports.wooConnectChannelUser31691670866271 = wooConnectChannelUser31691670866271;
35
+ //# sourceMappingURL=1691670866271-woo_connect_channel_user_3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691670866271-woo_connect_channel_user_3.js","sourceRoot":"","sources":["../../src/migrations/1691670866271-woo_connect_channel_user_3.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,mCAAmC;IAAhD;QACI,SAAI,GAAG,qCAAqC,CAAA;IAgBhD,CAAC;IAdgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;YACnF,MAAM,WAAW,CAAC,KAAK,CAAC,kGAAkG,CAAC,CAAC;YAC5H,MAAM,WAAW,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAC;YACtH,MAAM,WAAW,CAAC,KAAK,CAAC,8KAA8K,CAAC,CAAC;QAC5M,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC9G,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YACxG,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACtF,CAAC;KAAA;CAEJ;AAjBD,kFAiBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser41691671305372 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.wooConnectChannelUser41691671305372 = void 0;
13
+ class wooConnectChannelUser41691671305372 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser41691671305372';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`DROP INDEX \`IDX_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
20
+ yield queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
21
+ });
22
+ }
23
+ down(queryRunner) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
26
+ yield queryRunner.query(`CREATE UNIQUE INDEX \`IDX_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
27
+ });
28
+ }
29
+ }
30
+ exports.wooConnectChannelUser41691671305372 = wooConnectChannelUser41691671305372;
31
+ //# sourceMappingURL=1691671305372-woo_connect_channel_user_4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691671305372-woo_connect_channel_user_4.js","sourceRoot":"","sources":["../../src/migrations/1691671305372-woo_connect_channel_user_4.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,mCAAmC;IAAhD;QACI,SAAI,GAAG,qCAAqC,CAAA;IAYhD,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACnG,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAC;YACtH,MAAM,WAAW,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAC;QAC1H,CAAC;KAAA;CAEJ;AAbD,kFAaC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser51691671493692 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,29 @@
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.wooConnectChannelUser51691671493692 = void 0;
13
+ class wooConnectChannelUser51691671493692 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser51691671493692';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
20
+ });
21
+ }
22
+ down(queryRunner) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
25
+ });
26
+ }
27
+ }
28
+ exports.wooConnectChannelUser51691671493692 = wooConnectChannelUser51691671493692;
29
+ //# sourceMappingURL=1691671493692-woo_connect_channel_user_5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691671493692-woo_connect_channel_user_5.js","sourceRoot":"","sources":["../../src/migrations/1691671493692-woo_connect_channel_user_5.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,mCAAmC;IAAhD;QACI,SAAI,GAAG,qCAAqC,CAAA;IAUhD,CAAC;IARgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,8KAA8K,CAAC,CAAC;QAC5M,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;QAClH,CAAC;KAAA;CAEJ;AAXD,kFAWC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class wooConnectChannelUser61691679304105 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.wooConnectChannelUser61691679304105 = void 0;
13
+ class wooConnectChannelUser61691679304105 {
14
+ constructor() {
15
+ this.name = 'wooConnectChannelUser61691679304105';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
20
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`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 \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
26
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
27
+ });
28
+ }
29
+ }
30
+ exports.wooConnectChannelUser61691679304105 = wooConnectChannelUser61691679304105;
31
+ //# sourceMappingURL=1691679304105-woo_connect_channel_user_6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691679304105-woo_connect_channel_user_6.js","sourceRoot":"","sources":["../../src/migrations/1691679304105-woo_connect_channel_user_6.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,mCAAmC;IAAhD;QACI,SAAI,GAAG,qCAAqC,CAAA;IAYhD,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;YACnF,MAAM,WAAW,CAAC,KAAK,CAAC,8KAA8K,CAAC,CAAC;QAC5M,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC9G,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACtF,CAAC;KAAA;CAEJ;AAbD,kFAaC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class promoteToProduction1108231691764260299 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.promoteToProduction1108231691764260299 = void 0;
13
+ class promoteToProduction1108231691764260299 {
14
+ constructor() {
15
+ this.name = 'promoteToProduction1108231691764260299';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`woo_connection_id\` int NULL`);
20
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
21
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_fff56e95cc26550a1c6ae8f1863\` FOREIGN KEY (\`woo_connection_id\`) REFERENCES \`woo_connection\`(\`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 \`channel_user\` DROP FOREIGN KEY \`FK_fff56e95cc26550a1c6ae8f1863\``);
27
+ yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
28
+ yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`woo_connection_id\``);
29
+ });
30
+ }
31
+ }
32
+ exports.promoteToProduction1108231691764260299 = promoteToProduction1108231691764260299;
33
+ //# sourceMappingURL=1691764260299-promote_to_production_11_08_23.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1691764260299-promote_to_production_11_08_23.js","sourceRoot":"","sources":["../../src/migrations/1691764260299-promote_to_production_11_08_23.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,sCAAsC;IAAnD;QACI,SAAI,GAAG,wCAAwC,CAAA;IAcnD,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;YAC3F,MAAM,WAAW,CAAC,KAAK,CAAC,8KAA8K,CAAC,CAAC;YACxM,MAAM,WAAW,CAAC,KAAK,CAAC,kMAAkM,CAAC,CAAC;QAChO,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC9G,MAAM,WAAW,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;QAC9F,CAAC;KAAA;CAEJ;AAfD,wFAeC"}
@@ -1962,7 +1962,7 @@
1962
1962
  "affectsGlobalScope": false
1963
1963
  },
1964
1964
  "../src/entity/wooconnection.ts": {
1965
- "version": "30c55998866fc1d16037696e2a360b679789a7ed0072a50b9d2ac58d24b1f3a1",
1965
+ "version": "8fefcd04c679576dee12a2f9dae301895b48d71e5becca8a7f402e753f2628b2",
1966
1966
  "signature": "325f170f1bf4b774a97b7a92456965ff07cd6d5d6166364bca39ae7946ada940",
1967
1967
  "affectsGlobalScope": false
1968
1968
  },
@@ -2472,8 +2472,8 @@
2472
2472
  "affectsGlobalScope": false
2473
2473
  },
2474
2474
  "../src/entity/channeluser.ts": {
2475
- "version": "f99d7796f370f4c60a26ecd3e2d6b042336502d00e2087377b3b2e8ce2ccfef2",
2476
- "signature": "b5cfc310bf132bc5e972a17487c043e41dd68b670327b768ba3175ce6f464d58",
2475
+ "version": "8317bbeb8edf9186389cb335578e6e02b514e6dbda17da3658df4e69e89f0b1c",
2476
+ "signature": "35c8382e16ed3e1edfb8e3b4dba745bb0f6ac24aad4e51eb4bff043c7db6f75c",
2477
2477
  "affectsGlobalScope": false
2478
2478
  },
2479
2479
  "../src/entity/channel.ts": {
@@ -3416,11 +3416,56 @@
3416
3416
  "signature": "feaee38c1bd8210d9a44b2ae43fcd87f931007e469a62d53629dc10369ae4663",
3417
3417
  "affectsGlobalScope": false
3418
3418
  },
3419
+ "../src/migrations/1689345976870-promote_to_development_14_07_23.ts": {
3420
+ "version": "c9e2f7287f8e29046870a4a1869ccadd300d417f6d47fb4a03d1792a72c24648",
3421
+ "signature": "876663add4e6e05ab3e0b5e524b3bed504f0f451fd27835cc45fec964628ce6b",
3422
+ "affectsGlobalScope": false
3423
+ },
3419
3424
  "../src/migrations/1689702729291-discount-applied.ts": {
3420
3425
  "version": "ece79e0979400485485a582cf238cf7d1b9a201b954c201e25e5194009aa3671",
3421
3426
  "signature": "1c8a23b3581b71c2143753b23c74a5928a97c29acdf1bde0e02ba7d228a444b1",
3422
3427
  "affectsGlobalScope": false
3423
3428
  },
3429
+ "../src/migrations/1689964936496-promote_to_production_21_07_23_01.ts": {
3430
+ "version": "4856cefe60d937de7d2bfb93312815df58b54f5a9caa88bb320d5e964e6e9f9a",
3431
+ "signature": "2eade023cb4668f42a8a2c7ff945a739f7d8d40952dce077801b62db04927ee2",
3432
+ "affectsGlobalScope": false
3433
+ },
3434
+ "../src/migrations/1691662129283-woo_connect_channel_user.ts": {
3435
+ "version": "7655f19b82a90f413bd33f0fa6d2576d20a188aeccae18e08e0474887f7c922d",
3436
+ "signature": "214ed76806fee8b9b57628e9813e1e7f8d7733c500803838c210a268409f2fb9",
3437
+ "affectsGlobalScope": false
3438
+ },
3439
+ "../src/migrations/1691670038774-woo_connect_channel_user_1.ts": {
3440
+ "version": "bd394240ca3e2780d597b9e71272193ced4c26c464ff8191d23eb19bff9c9477",
3441
+ "signature": "57d196d9f815dbbb4700e01e0f0a8341e302372e06d2ad3a46a4d382119da417",
3442
+ "affectsGlobalScope": false
3443
+ },
3444
+ "../src/migrations/1691670866271-woo_connect_channel_user_3.ts": {
3445
+ "version": "f33d9a21d05b2774090e9d6a4bd0e82059d084c748e7de4f290e795f131688da",
3446
+ "signature": "3c7f1bc41f04054e4b75451e9fb405a28ca4f26a3a0d6a109309eb7b2e9e1958",
3447
+ "affectsGlobalScope": false
3448
+ },
3449
+ "../src/migrations/1691671305372-woo_connect_channel_user_4.ts": {
3450
+ "version": "57e6c0fac78d890c3cb0857d39c9eb765172d49e8c1e926b8c44e4af15604158",
3451
+ "signature": "37c7a95be3934e58bd5b44a251d122a7846c182da51f78c839123bb8596ac345",
3452
+ "affectsGlobalScope": false
3453
+ },
3454
+ "../src/migrations/1691671493692-woo_connect_channel_user_5.ts": {
3455
+ "version": "c2583ea0c1e997dbd6d7625f31c15dc8fd8825985d6538c3a6d0aeced73221ea",
3456
+ "signature": "de30be4f375b6d499768780cd8aaa81b4ffda1e31484cd41194d74a942f50ced",
3457
+ "affectsGlobalScope": false
3458
+ },
3459
+ "../src/migrations/1691679304105-woo_connect_channel_user_6.ts": {
3460
+ "version": "be50bc729defdb8a7adba4d867e8fbf8f2fc2d5280319fb59acd5a7449852c97",
3461
+ "signature": "86ef9ddab9ac6f8f51713b2468d0f5cdbc067768ff214c4294731715b5e797f4",
3462
+ "affectsGlobalScope": false
3463
+ },
3464
+ "../src/migrations/1691764260299-promote_to_production_11_08_23.ts": {
3465
+ "version": "c83af810f202930f2391b55df1e8f1d1b7fb33d59521fa9d0c69bfaef723c6df",
3466
+ "signature": "852f21f4671e0a81bcd2542867340e2d7f7eec94cc18a680f69268a4bfe8483a",
3467
+ "affectsGlobalScope": false
3468
+ },
3424
3469
  "../src/migrations/execute/index.ts": {
3425
3470
  "version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
3426
3471
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -5420,7 +5465,8 @@
5420
5465
  "../src/entity/channeluserproductsync.ts",
5421
5466
  "../src/entity/shopifyconnection.ts",
5422
5467
  "../src/entity/user.ts",
5423
- "../src/entity/userchannelapikey.ts"
5468
+ "../src/entity/userchannelapikey.ts",
5469
+ "../src/entity/wooconnection.ts"
5424
5470
  ],
5425
5471
  "../src/entity/channeluserproductsync.ts": [
5426
5472
  "../node_modules/typeorm/index.d.ts",
@@ -6359,9 +6405,36 @@
6359
6405
  "../src/migrations/1689279346515-add-discount-user.ts": [
6360
6406
  "../node_modules/typeorm/index.d.ts"
6361
6407
  ],
6408
+ "../src/migrations/1689345976870-promote_to_development_14_07_23.ts": [
6409
+ "../node_modules/typeorm/index.d.ts"
6410
+ ],
6362
6411
  "../src/migrations/1689702729291-discount-applied.ts": [
6363
6412
  "../node_modules/typeorm/index.d.ts"
6364
6413
  ],
6414
+ "../src/migrations/1689964936496-promote_to_production_21_07_23_01.ts": [
6415
+ "../node_modules/typeorm/index.d.ts"
6416
+ ],
6417
+ "../src/migrations/1691662129283-woo_connect_channel_user.ts": [
6418
+ "../node_modules/typeorm/index.d.ts"
6419
+ ],
6420
+ "../src/migrations/1691670038774-woo_connect_channel_user_1.ts": [
6421
+ "../node_modules/typeorm/index.d.ts"
6422
+ ],
6423
+ "../src/migrations/1691670866271-woo_connect_channel_user_3.ts": [
6424
+ "../node_modules/typeorm/index.d.ts"
6425
+ ],
6426
+ "../src/migrations/1691671305372-woo_connect_channel_user_4.ts": [
6427
+ "../node_modules/typeorm/index.d.ts"
6428
+ ],
6429
+ "../src/migrations/1691671493692-woo_connect_channel_user_5.ts": [
6430
+ "../node_modules/typeorm/index.d.ts"
6431
+ ],
6432
+ "../src/migrations/1691679304105-woo_connect_channel_user_6.ts": [
6433
+ "../node_modules/typeorm/index.d.ts"
6434
+ ],
6435
+ "../src/migrations/1691764260299-promote_to_production_11_08_23.ts": [
6436
+ "../node_modules/typeorm/index.d.ts"
6437
+ ],
6365
6438
  "../src/migrations/execute/index.ts": [
6366
6439
  "../src/config/connect.ts"
6367
6440
  ],
@@ -8359,7 +8432,8 @@
8359
8432
  "../src/entity/channeluserproductsync.ts",
8360
8433
  "../src/entity/shopifyconnection.ts",
8361
8434
  "../src/entity/user.ts",
8362
- "../src/entity/userchannelapikey.ts"
8435
+ "../src/entity/userchannelapikey.ts",
8436
+ "../src/entity/wooconnection.ts"
8363
8437
  ],
8364
8438
  "../src/entity/channeluserproductsync.ts": [
8365
8439
  "../src/entity/auditedmodel.ts",
@@ -9156,9 +9230,36 @@
9156
9230
  "../src/migrations/1689279346515-add-discount-user.ts": [
9157
9231
  "../node_modules/typeorm/index.d.ts"
9158
9232
  ],
9233
+ "../src/migrations/1689345976870-promote_to_development_14_07_23.ts": [
9234
+ "../node_modules/typeorm/index.d.ts"
9235
+ ],
9159
9236
  "../src/migrations/1689702729291-discount-applied.ts": [
9160
9237
  "../node_modules/typeorm/index.d.ts"
9161
9238
  ],
9239
+ "../src/migrations/1689964936496-promote_to_production_21_07_23_01.ts": [
9240
+ "../node_modules/typeorm/index.d.ts"
9241
+ ],
9242
+ "../src/migrations/1691662129283-woo_connect_channel_user.ts": [
9243
+ "../node_modules/typeorm/index.d.ts"
9244
+ ],
9245
+ "../src/migrations/1691670038774-woo_connect_channel_user_1.ts": [
9246
+ "../node_modules/typeorm/index.d.ts"
9247
+ ],
9248
+ "../src/migrations/1691670866271-woo_connect_channel_user_3.ts": [
9249
+ "../node_modules/typeorm/index.d.ts"
9250
+ ],
9251
+ "../src/migrations/1691671305372-woo_connect_channel_user_4.ts": [
9252
+ "../node_modules/typeorm/index.d.ts"
9253
+ ],
9254
+ "../src/migrations/1691671493692-woo_connect_channel_user_5.ts": [
9255
+ "../node_modules/typeorm/index.d.ts"
9256
+ ],
9257
+ "../src/migrations/1691679304105-woo_connect_channel_user_6.ts": [
9258
+ "../node_modules/typeorm/index.d.ts"
9259
+ ],
9260
+ "../src/migrations/1691764260299-promote_to_production_11_08_23.ts": [
9261
+ "../node_modules/typeorm/index.d.ts"
9262
+ ],
9162
9263
  "../src/migrations/index.ts": [
9163
9264
  "../src/migrations/1628474597284-initialschema.ts",
9164
9265
  "../src/migrations/1630077596132-removemangopay.ts",
@@ -9998,7 +10099,16 @@
9998
10099
  "../src/migrations/1689005718747-add-active-colum-in-variant.ts",
9999
10100
  "../src/migrations/1689020331011-add-discount.ts",
10000
10101
  "../src/migrations/1689279346515-add-discount-user.ts",
10102
+ "../src/migrations/1689345976870-promote_to_development_14_07_23.ts",
10001
10103
  "../src/migrations/1689702729291-discount-applied.ts",
10104
+ "../src/migrations/1689964936496-promote_to_production_21_07_23_01.ts",
10105
+ "../src/migrations/1691662129283-woo_connect_channel_user.ts",
10106
+ "../src/migrations/1691670038774-woo_connect_channel_user_1.ts",
10107
+ "../src/migrations/1691670866271-woo_connect_channel_user_3.ts",
10108
+ "../src/migrations/1691671305372-woo_connect_channel_user_4.ts",
10109
+ "../src/migrations/1691671493692-woo_connect_channel_user_5.ts",
10110
+ "../src/migrations/1691679304105-woo_connect_channel_user_6.ts",
10111
+ "../src/migrations/1691764260299-promote_to_production_11_08_23.ts",
10002
10112
  "../src/migrations/execute/index.ts",
10003
10113
  "../src/migrations/index.ts",
10004
10114
  "../src/repositories/discount/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reachu/database",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
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.99",
25
- "@reachu/utils": "1.0.99",
24
+ "@reachu/logger": "1.0.101",
25
+ "@reachu/utils": "1.0.101",
26
26
  "dotenv": "8.0.0",
27
27
  "express": "4.17.1",
28
28
  "mysql2": "1.5.2",
@@ -13,6 +13,8 @@ import ChannelGroup from './ChannelGroup';
13
13
  import ChannelUserProductSync from './ChannelUserProductSync';
14
14
  import User from './User';
15
15
  import ShopifyConnection from './ShopifyConnection';
16
+ import WooConnection from './WooConnection';
17
+
16
18
  import UserChannelApiKey from './UserChannelApiKey';
17
19
 
18
20
  @Entity()
@@ -50,13 +52,21 @@ export default class ChannelUser extends AuditedModel {
50
52
  @JoinColumn()
51
53
  channelUserProductSync: ChannelUserProductSync[];
52
54
 
53
- @ManyToOne(() => ShopifyConnection, (shopifyConnection) => shopifyConnection.id, { nullable: true })
55
+ @ManyToOne(() => ShopifyConnection, (shopifyConnection) => shopifyConnection.id, {
56
+ nullable: true,
57
+ })
54
58
  @JoinColumn()
55
59
  shopifyConnection: ShopifyConnection;
56
60
 
61
+ @ManyToOne(() => WooConnection, (wooConnection) => wooConnection.id, {
62
+ nullable: true,
63
+ })
64
+ @JoinColumn()
65
+ wooConnection: WooConnection;
57
66
 
58
- @ManyToOne(() => UserChannelApiKey, (userChannelApiKey) => userChannelApiKey.id, { nullable: true })
67
+ @ManyToOne(() => UserChannelApiKey, (userChannelApiKey) => userChannelApiKey.id, {
68
+ nullable: true,
69
+ })
59
70
  @JoinColumn()
60
71
  userChannelApiKey: UserChannelApiKey;
61
-
62
72
  }
@@ -1,4 +1,4 @@
1
- import { Entity, PrimaryGeneratedColumn, Column, JoinColumn, OneToOne } from 'typeorm';
1
+ import { Entity, PrimaryGeneratedColumn, Column, JoinColumn, ManyToOne } from 'typeorm';
2
2
  import User from './User';
3
3
 
4
4
  @Entity()
@@ -18,7 +18,7 @@ export default class WooConnection {
18
18
  @Column('varchar', { nullable: true })
19
19
  currency?: string;
20
20
 
21
- @OneToOne(() => User, (user) => user.woo, { onDelete: 'CASCADE' })
21
+ @ManyToOne(() => User, (user) => user.woo, { onDelete: 'CASCADE' })
22
22
  @JoinColumn()
23
23
  user: User;
24
24
  }
@@ -0,0 +1,32 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class promoteToDevelopment1407231689345976870 implements MigrationInterface {
4
+ name = 'promoteToDevelopment1407231689345976870'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`DROP INDEX \`FK_adc2206f21efb67f9f6425a4ce8\` ON \`user_channel_api_key\``);
8
+ await queryRunner.query(`ALTER TABLE \`variant\` DROP COLUMN \`active\``);
9
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` DROP COLUMN \`channel_user_id\``);
10
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`shopify_connection_id\` int NULL`);
11
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`user_channel_api_key_id\` int NULL`);
12
+ await queryRunner.query(`ALTER TABLE \`imported_product\` ADD \`channel_user_id\` int NULL`);
13
+ await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
14
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_687a267ae83f576c002baf0198a\` FOREIGN KEY (\`shopify_connection_id\`) REFERENCES \`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
15
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_83f345b5912388def4fa4253040\` FOREIGN KEY (\`user_channel_api_key_id\`) REFERENCES \`user_channel_api_key\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
16
+ await queryRunner.query(`ALTER TABLE \`imported_product\` ADD CONSTRAINT \`FK_f8bdfc8b3e1fdf9e96a351d73e2\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
17
+ }
18
+
19
+ public async down(queryRunner: QueryRunner): Promise<void> {
20
+ await queryRunner.query(`ALTER TABLE \`imported_product\` DROP FOREIGN KEY \`FK_f8bdfc8b3e1fdf9e96a351d73e2\``);
21
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_83f345b5912388def4fa4253040\``);
22
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_687a267ae83f576c002baf0198a\``);
23
+ await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
24
+ await queryRunner.query(`ALTER TABLE \`imported_product\` DROP COLUMN \`channel_user_id\``);
25
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`user_channel_api_key_id\``);
26
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`shopify_connection_id\``);
27
+ await queryRunner.query(`ALTER TABLE \`user_channel_api_key\` ADD \`channel_user_id\` int NULL`);
28
+ await queryRunner.query(`ALTER TABLE \`variant\` ADD \`active\` tinyint NOT NULL DEFAULT '1'`);
29
+ await queryRunner.query(`CREATE INDEX \`FK_adc2206f21efb67f9f6425a4ce8\` ON \`user_channel_api_key\` (\`channel_user_id\`)`);
30
+ }
31
+
32
+ }
@@ -0,0 +1,78 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class promoteToProduction210723011689964936496 implements MigrationInterface {
4
+ name = 'promoteToProduction210723011689964936496'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`webhook_template_ecommerce\` (\`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, \`connection\` tinyint NOT NULL DEFAULT 0, \`response\` varchar(21844) NULL, \`type\` varchar(255) NULL, \`url_params\` varchar(255) NULL, \`body\` varchar(21844) NULL, \`title\` varchar(255) NOT NULL, \`user_template_ecommerce_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE TABLE \`discount_type\` (\`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, \`type\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
9
+ await queryRunner.query(`CREATE TABLE \`discount_product\` (\`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, \`product_id\` int NOT NULL, \`discount_id\` int NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
10
+ await queryRunner.query(`CREATE TABLE \`discount_cart\` (\`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, \`applied\` tinyint NOT NULL DEFAULT 0, \`discount_id\` int NOT NULL, \`cart_id\` varchar(36) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
11
+ await queryRunner.query(`CREATE TABLE \`discount\` (\`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, \`discount_count\` int NULL, \`code\` varchar(255) NOT NULL, \`percentage\` int NOT NULL, \`start_date\` datetime NOT NULL, \`end_date\` datetime NOT NULL, \`discount_type_id\` int NOT NULL, \`user_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
12
+ await queryRunner.query(`ALTER TABLE \`variant\` ADD \`active\` tinyint NOT NULL DEFAULT 1`);
13
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`custom_name\` varchar(255) NULL`);
14
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`shopify_connection_id\` int NULL`);
15
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`user_channel_api_key_id\` int NULL`);
16
+ await queryRunner.query(`ALTER TABLE \`imported_product\` ADD \`channel_user_id\` int NULL`);
17
+ await queryRunner.query(`ALTER TABLE \`cart\` ADD \`shipping_country\` varchar(255) NULL`);
18
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`shipping_country_id\` varchar(36) NULL`);
19
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`type\` varchar(255) NULL`);
20
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`body\` varchar(21844) NULL`);
21
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` ADD \`title\` varchar(255) NOT NULL`);
22
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_one_token_key\` varchar(255) NULL`);
23
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_one_token_secret\` varchar(255) NULL`);
24
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_id\` varchar(255) NULL`);
25
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_secret\` varchar(255) NULL`);
26
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_endpoint\` varchar(255) NULL`);
27
+ await queryRunner.query(`ALTER TABLE \`auth_info\` ADD \`oauth_two_client_audience\` varchar(255) NULL`);
28
+ await queryRunner.query(`ALTER TABLE \`shopify_connection\` ADD CONSTRAINT \`FK_9499974cf522429803e172a6276\` FOREIGN KEY (\`reseller_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
29
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_687a267ae83f576c002baf0198a\` FOREIGN KEY (\`shopify_connection_id\`) REFERENCES \`shopify_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
30
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_83f345b5912388def4fa4253040\` FOREIGN KEY (\`user_channel_api_key_id\`) REFERENCES \`user_channel_api_key\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
31
+ await queryRunner.query(`ALTER TABLE \`imported_product\` ADD CONSTRAINT \`FK_f8bdfc8b3e1fdf9e96a351d73e2\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
32
+ await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_3bc8725061c3cea8a94060bfc9d\` FOREIGN KEY (\`shipping_country_id\`) REFERENCES \`shipping_country\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
33
+ await queryRunner.query(`ALTER TABLE \`webhook_template_ecommerce\` ADD CONSTRAINT \`FK_b05fbf9109c855ceedd94df1b09\` FOREIGN KEY (\`user_template_ecommerce_id\`) REFERENCES \`user_template_ecommerce\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
34
+ await queryRunner.query(`ALTER TABLE \`discount_product\` ADD CONSTRAINT \`FK_6939b3f91b1db4d133d20c33e3b\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
35
+ await queryRunner.query(`ALTER TABLE \`discount_product\` ADD CONSTRAINT \`FK_6cfb1683e023b96a42f7e72edd6\` FOREIGN KEY (\`discount_id\`) REFERENCES \`discount\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
36
+ await queryRunner.query(`ALTER TABLE \`discount_cart\` ADD CONSTRAINT \`FK_ff034b5de6a90766ce209ae92a4\` FOREIGN KEY (\`discount_id\`) REFERENCES \`discount\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
37
+ await queryRunner.query(`ALTER TABLE \`discount_cart\` ADD CONSTRAINT \`FK_42951860fa261b863933523298e\` FOREIGN KEY (\`cart_id\`) REFERENCES \`cart\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
38
+ await queryRunner.query(`ALTER TABLE \`discount\` ADD CONSTRAINT \`FK_40b4ec0b1661fe175e00646f507\` FOREIGN KEY (\`discount_type_id\`) REFERENCES \`discount_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
39
+ await queryRunner.query(`ALTER TABLE \`discount\` ADD CONSTRAINT \`FK_494f73684a24415ee7becc8cb6a\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
40
+ }
41
+
42
+ public async down(queryRunner: QueryRunner): Promise<void> {
43
+ await queryRunner.query(`ALTER TABLE \`discount\` DROP FOREIGN KEY \`FK_494f73684a24415ee7becc8cb6a\``);
44
+ await queryRunner.query(`ALTER TABLE \`discount\` DROP FOREIGN KEY \`FK_40b4ec0b1661fe175e00646f507\``);
45
+ await queryRunner.query(`ALTER TABLE \`discount_cart\` DROP FOREIGN KEY \`FK_42951860fa261b863933523298e\``);
46
+ await queryRunner.query(`ALTER TABLE \`discount_cart\` DROP FOREIGN KEY \`FK_ff034b5de6a90766ce209ae92a4\``);
47
+ await queryRunner.query(`ALTER TABLE \`discount_product\` DROP FOREIGN KEY \`FK_6cfb1683e023b96a42f7e72edd6\``);
48
+ await queryRunner.query(`ALTER TABLE \`discount_product\` DROP FOREIGN KEY \`FK_6939b3f91b1db4d133d20c33e3b\``);
49
+ await queryRunner.query(`ALTER TABLE \`webhook_template_ecommerce\` DROP FOREIGN KEY \`FK_b05fbf9109c855ceedd94df1b09\``);
50
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_3bc8725061c3cea8a94060bfc9d\``);
51
+ await queryRunner.query(`ALTER TABLE \`imported_product\` DROP FOREIGN KEY \`FK_f8bdfc8b3e1fdf9e96a351d73e2\``);
52
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_83f345b5912388def4fa4253040\``);
53
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_687a267ae83f576c002baf0198a\``);
54
+ await queryRunner.query(`ALTER TABLE \`shopify_connection\` DROP FOREIGN KEY \`FK_9499974cf522429803e172a6276\``);
55
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_audience\``);
56
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_endpoint\``);
57
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_secret\``);
58
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_two_client_id\``);
59
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_one_token_secret\``);
60
+ await queryRunner.query(`ALTER TABLE \`auth_info\` DROP COLUMN \`oauth_one_token_key\``);
61
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`title\``);
62
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`body\``);
63
+ await queryRunner.query(`ALTER TABLE \`endpoint_template_ecommerce\` DROP COLUMN \`type\``);
64
+ await queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`shipping_country_id\``);
65
+ await queryRunner.query(`ALTER TABLE \`cart\` DROP COLUMN \`shipping_country\``);
66
+ await queryRunner.query(`ALTER TABLE \`imported_product\` DROP COLUMN \`channel_user_id\``);
67
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`user_channel_api_key_id\``);
68
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`shopify_connection_id\``);
69
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`custom_name\``);
70
+ await queryRunner.query(`ALTER TABLE \`variant\` DROP COLUMN \`active\``);
71
+ await queryRunner.query(`DROP TABLE \`discount\``);
72
+ await queryRunner.query(`DROP TABLE \`discount_cart\``);
73
+ await queryRunner.query(`DROP TABLE \`discount_product\``);
74
+ await queryRunner.query(`DROP TABLE \`discount_type\``);
75
+ await queryRunner.query(`DROP TABLE \`webhook_template_ecommerce\``);
76
+ }
77
+
78
+ }
@@ -0,0 +1,16 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser1691662129283 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser1691662129283'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`woo_connection_id\` int NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_fff56e95cc26550a1c6ae8f1863\` FOREIGN KEY (\`woo_connection_id\`) REFERENCES \`woo_connection\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ public async down(queryRunner: QueryRunner): Promise<void> {
12
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_fff56e95cc26550a1c6ae8f1863\``);
13
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`woo_connection_id\``);
14
+ }
15
+
16
+ }
@@ -0,0 +1,18 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser11691670038774 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser11691670038774'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
8
+ await queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
9
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
10
+ }
11
+
12
+ public async down(queryRunner: QueryRunner): Promise<void> {
13
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
14
+ await queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
15
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
16
+ }
17
+
18
+ }
@@ -0,0 +1,20 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser31691670866271 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser31691670866271'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD UNIQUE INDEX \`IDX_c61b68995acf5a1a32f2c60175\` (\`user_id\`)`);
9
+ await queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
10
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
11
+ }
12
+
13
+ public async down(queryRunner: QueryRunner): Promise<void> {
14
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
15
+ await queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
16
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP INDEX \`IDX_c61b68995acf5a1a32f2c60175\``);
17
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
18
+ }
19
+
20
+ }
@@ -0,0 +1,16 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser41691671305372 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser41691671305372'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`DROP INDEX \`IDX_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
8
+ await queryRunner.query(`DROP INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\``);
9
+ }
10
+
11
+ public async down(queryRunner: QueryRunner): Promise<void> {
12
+ await queryRunner.query(`CREATE UNIQUE INDEX \`REL_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
13
+ await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_c61b68995acf5a1a32f2c60175\` ON \`woo_connection\` (\`user_id\`)`);
14
+ }
15
+
16
+ }
@@ -0,0 +1,14 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser51691671493692 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser51691671493692'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
8
+ }
9
+
10
+ public async down(queryRunner: QueryRunner): Promise<void> {
11
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
12
+ }
13
+
14
+ }
@@ -0,0 +1,16 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class wooConnectChannelUser61691679304105 implements MigrationInterface {
4
+ name = 'wooConnectChannelUser61691679304105'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`user_id\` int NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ public async down(queryRunner: QueryRunner): Promise<void> {
12
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
13
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`user_id\``);
14
+ }
15
+
16
+ }
@@ -0,0 +1,18 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class promoteToProduction1108231691764260299 implements MigrationInterface {
4
+ name = 'promoteToProduction1108231691764260299'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`woo_connection_id\` int NULL`);
8
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD CONSTRAINT \`FK_c61b68995acf5a1a32f2c601759\` FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
9
+ await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_fff56e95cc26550a1c6ae8f1863\` FOREIGN KEY (\`woo_connection_id\`) REFERENCES \`woo_connection\`(\`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 \`channel_user\` DROP FOREIGN KEY \`FK_fff56e95cc26550a1c6ae8f1863\``);
14
+ await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP FOREIGN KEY \`FK_c61b68995acf5a1a32f2c601759\``);
15
+ await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`woo_connection_id\``);
16
+ }
17
+
18
+ }