@reachu/database 1.0.71 → 1.0.73

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.
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class externalRequestV21684452476996 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.externalRequestV21684452476996 = void 0;
13
+ class externalRequestV21684452476996 {
14
+ constructor() {
15
+ this.name = 'externalRequestV21684452476996';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE \`external_request\` (\`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, \`receiver_email\` varchar(255) NOT NULL, \`collection\` int NULL DEFAULT '0', \`url\` varchar(255) NOT NULL, \`state\` int NULL DEFAULT '0', \`sender_id\` int NULL, \`plan_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
20
+ yield queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_c7fdd1f3e8a0f9deed266cf6d47\` FOREIGN KEY (\`sender_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
21
+ yield queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_6bba3dfa40a288826cda4ddacc5\` FOREIGN KEY (\`plan_id\`) REFERENCES \`plan\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
22
+ });
23
+ }
24
+ down(queryRunner) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ yield queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_6bba3dfa40a288826cda4ddacc5\``);
27
+ yield queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_c7fdd1f3e8a0f9deed266cf6d47\``);
28
+ yield queryRunner.query(`DROP TABLE \`external_request\``);
29
+ });
30
+ }
31
+ }
32
+ exports.externalRequestV21684452476996 = externalRequestV21684452476996;
33
+ //# sourceMappingURL=1684452476996-externalRequest_v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1684452476996-externalRequest_v2.js","sourceRoot":"","sources":["../../src/migrations/1684452476996-externalRequest_v2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,8BAA8B;IAA3C;QACI,SAAI,GAAG,gCAAgC,CAAA;IAc3C,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,2cAA2c,CAAC,CAAC;YACre,MAAM,WAAW,CAAC,KAAK,CAAC,kLAAkL,CAAC,CAAC;YAC5M,MAAM,WAAW,CAAC,KAAK,CAAC,gLAAgL,CAAC,CAAC;QAC9M,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAC/D,CAAC;KAAA;CAEJ;AAfD,wEAeC"}
@@ -3251,6 +3251,11 @@
3251
3251
  "signature": "55d83a9fd40ea572a7e5b735749b66a53d6743e310b062f95a0f428d9992e9fd",
3252
3252
  "affectsGlobalScope": false
3253
3253
  },
3254
+ "../src/migrations/1684452476996-externalrequest_v2.ts": {
3255
+ "version": "a2d1a0e14d2ae1974eff46e51e07921848a7de839ab708d537be58ed72da89d6",
3256
+ "signature": "c4e30a983142c885fadda46bd7ed591a288e328626bf9b271e639bd9413c32bb",
3257
+ "affectsGlobalScope": false
3258
+ },
3254
3259
  "../src/migrations/execute/index.ts": {
3255
3260
  "version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
3256
3261
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -6065,6 +6070,9 @@
6065
6070
  "../src/migrations/1684452127341-externalrequest_v1.ts": [
6066
6071
  "../node_modules/typeorm/index.d.ts"
6067
6072
  ],
6073
+ "../src/migrations/1684452476996-externalrequest_v2.ts": [
6074
+ "../node_modules/typeorm/index.d.ts"
6075
+ ],
6068
6076
  "../src/migrations/execute/index.ts": [
6069
6077
  "../src/config/connect.ts"
6070
6078
  ],
@@ -8734,6 +8742,9 @@
8734
8742
  "../src/migrations/1684452127341-externalrequest_v1.ts": [
8735
8743
  "../node_modules/typeorm/index.d.ts"
8736
8744
  ],
8745
+ "../src/migrations/1684452476996-externalrequest_v2.ts": [
8746
+ "../node_modules/typeorm/index.d.ts"
8747
+ ],
8737
8748
  "../src/migrations/index.ts": [
8738
8749
  "../src/migrations/1628474597284-initialschema.ts",
8739
8750
  "../src/migrations/1630077596132-removemangopay.ts",
@@ -9532,6 +9543,7 @@
9532
9543
  "../src/migrations/1684176902363-connections-update-2.ts",
9533
9544
  "../src/migrations/1684451330738-externalrequest.ts",
9534
9545
  "../src/migrations/1684452127341-externalrequest_v1.ts",
9546
+ "../src/migrations/1684452476996-externalrequest_v2.ts",
9535
9547
  "../src/migrations/execute/index.ts",
9536
9548
  "../src/migrations/index.ts",
9537
9549
  "../src/repositories/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reachu/database",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
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.71",
25
- "@reachu/utils": "1.0.71",
24
+ "@reachu/logger": "1.0.73",
25
+ "@reachu/utils": "1.0.73",
26
26
  "dotenv": "8.0.0",
27
27
  "express": "4.17.1",
28
28
  "mysql2": "1.5.2",
@@ -0,0 +1,18 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class externalRequestV21684452476996 implements MigrationInterface {
4
+ name = 'externalRequestV21684452476996'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`external_request\` (\`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, \`receiver_email\` varchar(255) NOT NULL, \`collection\` int NULL DEFAULT '0', \`url\` varchar(255) NOT NULL, \`state\` int NULL DEFAULT '0', \`sender_id\` int NULL, \`plan_id\` int NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_c7fdd1f3e8a0f9deed266cf6d47\` FOREIGN KEY (\`sender_id\`) REFERENCES \`user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
9
+ await queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_6bba3dfa40a288826cda4ddacc5\` FOREIGN KEY (\`plan_id\`) REFERENCES \`plan\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
10
+ }
11
+
12
+ public async down(queryRunner: QueryRunner): Promise<void> {
13
+ await queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_6bba3dfa40a288826cda4ddacc5\``);
14
+ await queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_c7fdd1f3e8a0f9deed266cf6d47\``);
15
+ await queryRunner.query(`DROP TABLE \`external_request\``);
16
+ }
17
+
18
+ }