finamaze_schema 1.35.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entity/documents.entity.d.ts +13 -0
- package/dist/entity/documents.entity.js +62 -0
- package/dist/entity/documents.entity.js.map +1 -0
- package/dist/entity/user.entity.d.ts +5 -3
- package/dist/entity/user.entity.js +9 -2
- package/dist/entity/user.entity.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/migrations/{1733323133759-v1.d.ts → 1740671890101-version1.d.ts} +1 -1
- package/dist/migrations/1740671890101-version1.js +48 -0
- package/dist/migrations/1740671890101-version1.js.map +1 -0
- package/dist/migrations/{1734104865215-v2.d.ts → 1740739347863-version2.d.ts} +1 -1
- package/dist/migrations/1740739347863-version2.js +18 -0
- package/dist/migrations/1740739347863-version2.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -2
- package/src/entity/documents.entity.ts +36 -0
- package/src/entity/user.entity.ts +64 -50
- package/src/index.ts +2 -1
- package/src/migrations/1740671890101-version1.ts +71 -0
- package/src/migrations/1740739347863-version2.ts +16 -0
- package/tsconfig.json +1 -1
- package/dist/migrations/1733323133759-v1.js +0 -38
- package/dist/migrations/1733323133759-v1.js.map +0 -1
- package/dist/migrations/1733996187627-removeUniqueValue.d.ts +0 -6
- package/dist/migrations/1733996187627-removeUniqueValue.js +0 -18
- package/dist/migrations/1733996187627-removeUniqueValue.js.map +0 -1
- package/dist/migrations/1734104865215-v2.js +0 -26
- package/dist/migrations/1734104865215-v2.js.map +0 -1
@@ -0,0 +1,13 @@
|
|
1
|
+
import { User } from './user.entity';
|
2
|
+
export declare class Documents {
|
3
|
+
id: number;
|
4
|
+
reference_id: string;
|
5
|
+
type: string;
|
6
|
+
context: string;
|
7
|
+
status: string;
|
8
|
+
hash: string;
|
9
|
+
metadata: string;
|
10
|
+
created_at: Date;
|
11
|
+
updated_at: Date;
|
12
|
+
user: User;
|
13
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.Documents = void 0;
|
13
|
+
const typeorm_1 = require("typeorm");
|
14
|
+
const user_entity_1 = require("./user.entity");
|
15
|
+
let Documents = class Documents {
|
16
|
+
};
|
17
|
+
exports.Documents = Documents;
|
18
|
+
__decorate([
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
20
|
+
__metadata("design:type", Number)
|
21
|
+
], Documents.prototype, "id", void 0);
|
22
|
+
__decorate([
|
23
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
24
|
+
__metadata("design:type", String)
|
25
|
+
], Documents.prototype, "reference_id", void 0);
|
26
|
+
__decorate([
|
27
|
+
(0, typeorm_1.Column)(),
|
28
|
+
__metadata("design:type", String)
|
29
|
+
], Documents.prototype, "type", void 0);
|
30
|
+
__decorate([
|
31
|
+
(0, typeorm_1.Column)(),
|
32
|
+
__metadata("design:type", String)
|
33
|
+
], Documents.prototype, "context", void 0);
|
34
|
+
__decorate([
|
35
|
+
(0, typeorm_1.Column)(),
|
36
|
+
__metadata("design:type", String)
|
37
|
+
], Documents.prototype, "status", void 0);
|
38
|
+
__decorate([
|
39
|
+
(0, typeorm_1.Column)(),
|
40
|
+
__metadata("design:type", String)
|
41
|
+
], Documents.prototype, "hash", void 0);
|
42
|
+
__decorate([
|
43
|
+
(0, typeorm_1.Column)(),
|
44
|
+
__metadata("design:type", String)
|
45
|
+
], Documents.prototype, "metadata", void 0);
|
46
|
+
__decorate([
|
47
|
+
(0, typeorm_1.CreateDateColumn)(),
|
48
|
+
__metadata("design:type", Date)
|
49
|
+
], Documents.prototype, "created_at", void 0);
|
50
|
+
__decorate([
|
51
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
52
|
+
__metadata("design:type", Date)
|
53
|
+
], Documents.prototype, "updated_at", void 0);
|
54
|
+
__decorate([
|
55
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.documents, { nullable: false }),
|
56
|
+
__metadata("design:type", user_entity_1.User)
|
57
|
+
], Documents.prototype, "user", void 0);
|
58
|
+
exports.Documents = Documents = __decorate([
|
59
|
+
(0, typeorm_1.Entity)(),
|
60
|
+
(0, typeorm_1.Unique)(['hash'])
|
61
|
+
], Documents);
|
62
|
+
//# sourceMappingURL=documents.entity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"documents.entity.js","sourceRoot":"","sources":["../../src/entity/documents.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwH;AACxH,+CAAqC;AAI9B,IAAM,SAAS,GAAf,MAAM,SAAS;CA8BrB,CAAA;AA9BY,8BAAS;AAEpB;IADC,IAAA,gCAAsB,GAAE;;qCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGrB;IADC,IAAA,gBAAM,GAAE;;uCACI;AAGb;IADC,IAAA,gBAAM,GAAE;;0CACO;AAGhB;IADC,IAAA,gBAAM,GAAE;;yCACM;AAGf;IADC,IAAA,gBAAM,GAAE;;uCACI;AAGb;IADC,IAAA,gBAAM,GAAE;;2CACQ;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;6CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;6CAAC;AAGjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC/D,kBAAI;uCAAC;oBA7BA,SAAS;IAFrB,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,MAAM,CAAC,CAAC;GACJ,SAAS,CA8BrB"}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { PhoneNumber } from
|
2
|
-
import { Email } from
|
3
|
-
import { GoalPlan } from
|
1
|
+
import { PhoneNumber } from "./phone-number.entity";
|
2
|
+
import { Email } from "./email.entity";
|
3
|
+
import { GoalPlan } from "./goalPlan.entity";
|
4
|
+
import { Documents } from "./documents.entity";
|
4
5
|
export declare class User {
|
5
6
|
id: number;
|
6
7
|
username: string;
|
@@ -23,4 +24,5 @@ export declare class User {
|
|
23
24
|
created_at: Date;
|
24
25
|
updated_at: Date;
|
25
26
|
goal_plans: GoalPlan[];
|
27
|
+
documents: Documents[];
|
26
28
|
}
|
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
|
|
14
14
|
const phone_number_entity_1 = require("./phone-number.entity");
|
15
15
|
const email_entity_1 = require("./email.entity");
|
16
16
|
const goalPlan_entity_1 = require("./goalPlan.entity");
|
17
|
+
const documents_entity_1 = require("./documents.entity");
|
17
18
|
let User = class User {
|
18
19
|
};
|
19
20
|
exports.User = User;
|
@@ -42,7 +43,9 @@ __decorate([
|
|
42
43
|
__metadata("design:type", String)
|
43
44
|
], User.prototype, "phone_number", void 0);
|
44
45
|
__decorate([
|
45
|
-
(0, typeorm_1.OneToMany)(() => phone_number_entity_1.PhoneNumber, (phoneNumber) => phoneNumber.user, {
|
46
|
+
(0, typeorm_1.OneToMany)(() => phone_number_entity_1.PhoneNumber, (phoneNumber) => phoneNumber.user, {
|
47
|
+
cascade: true,
|
48
|
+
}),
|
46
49
|
__metadata("design:type", Array)
|
47
50
|
], User.prototype, "phone_numbers", void 0);
|
48
51
|
__decorate([
|
@@ -101,8 +104,12 @@ __decorate([
|
|
101
104
|
(0, typeorm_1.OneToMany)(() => goalPlan_entity_1.GoalPlan, (goalPlan) => goalPlan.user, { cascade: true }),
|
102
105
|
__metadata("design:type", Array)
|
103
106
|
], User.prototype, "goal_plans", void 0);
|
107
|
+
__decorate([
|
108
|
+
(0, typeorm_1.OneToMany)(() => documents_entity_1.Documents, (document) => document.user, { cascade: true }),
|
109
|
+
__metadata("design:type", Array)
|
110
|
+
], User.prototype, "documents", void 0);
|
104
111
|
exports.User = User = __decorate([
|
105
112
|
(0, typeorm_1.Entity)(),
|
106
|
-
(0, typeorm_1.Unique)([
|
113
|
+
(0, typeorm_1.Unique)(["username"])
|
107
114
|
], User);
|
108
115
|
//# sourceMappingURL=user.entity.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entity/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entity/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AACjB,+DAAoD;AACpD,iDAAuC;AACvC,uDAA6C;AAC7C,yDAA+C;AAIxC,IAAM,IAAI,GAAV,MAAM,IAAI;CAsEhB,CAAA;AAtEY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;sCACX;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCACb;AAGd;IADC,IAAA,mBA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M,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACH;AAIxB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;wCAAC;AAIjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;wCAAC;AAGjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wCACnD;AAGvB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;uCACpD;eArEZ,IAAI;IAFhB,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,UAAU,CAAC,CAAC;GACR,IAAI,CAsEhB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -19,4 +19,5 @@ __exportStar(require("./entity/manager.entity"), exports);
|
|
19
19
|
__exportStar(require("./entity/phone-number.entity"), exports);
|
20
20
|
__exportStar(require("./entity/email.entity"), exports);
|
21
21
|
__exportStar(require("./entity/goalPlan.entity"), exports);
|
22
|
+
__exportStar(require("./entity/documents.entity"), exports);
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA,uDAAqC;AACrC,0DAAwC;AACxC,+DAA6C;AAC7C,wDAAsC;AACtC,2DAAyC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA,uDAAqC;AACrC,0DAAwC;AACxC,+DAA6C;AAC7C,wDAAsC;AACtC,2DAAyC;AACzC,4DAA0C"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
2
|
-
export declare class
|
2
|
+
export declare class Version11740671890101 implements MigrationInterface {
|
3
3
|
name: string;
|
4
4
|
up(queryRunner: QueryRunner): Promise<void>;
|
5
5
|
down(queryRunner: QueryRunner): Promise<void>;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Version11740671890101 = void 0;
|
4
|
+
class Version11740671890101 {
|
5
|
+
constructor() {
|
6
|
+
this.name = "Version11740671890101";
|
7
|
+
}
|
8
|
+
async up(queryRunner) {
|
9
|
+
const phone_number = await queryRunner.hasTable("phone_number");
|
10
|
+
if (!phone_number) {
|
11
|
+
await queryRunner.query(`CREATE TABLE "phone_number" ("id" number GENERATED BY DEFAULT AS IDENTITY, "number" varchar2(255) NOT NULL, "userId" number NOT NULL, CONSTRAINT "PK_c16f58426537a660b3f2a26e983" PRIMARY KEY ("id"))`);
|
12
|
+
}
|
13
|
+
const email = await queryRunner.hasTable("email");
|
14
|
+
if (!email) {
|
15
|
+
await queryRunner.query(`CREATE TABLE "email" ("id" number GENERATED BY DEFAULT AS IDENTITY, "address" varchar2(255) NOT NULL, "userId" number NOT NULL, CONSTRAINT "PK_1e7ed8734ee054ef18002e29b1c" PRIMARY KEY ("id"))`);
|
16
|
+
}
|
17
|
+
const goal_plan = await queryRunner.hasTable("goal_plan");
|
18
|
+
if (!goal_plan) {
|
19
|
+
await queryRunner.query(`CREATE TABLE "goal_plan" ("id" number GENERATED BY DEFAULT AS IDENTITY, "objective" varchar2(255) NOT NULL, "currency" varchar2(3) NOT NULL, "initial_amount" number, "target_amount" number, "contribution_amount" number, "contribution_frequency" varchar2(255) NOT NULL, "start_date" varchar2(255) NOT NULL, "investment_duration" number, "userId" number NOT NULL, CONSTRAINT "PK_02a5c53bc719b6694de4bbbe530" PRIMARY KEY ("id"))`);
|
20
|
+
}
|
21
|
+
const user = await queryRunner.hasTable("user");
|
22
|
+
if (!user) {
|
23
|
+
await queryRunner.query(`CREATE TABLE "user" ("id" number GENERATED BY DEFAULT AS IDENTITY, "username" varchar2(255) NOT NULL, "email" varchar2(255), "password" varchar2(255), "phone_number" varchar2(255), "iqama_number" varchar2(255), "is_profile_complete" number, "registration_step" varchar2(255), "smartcore_reference_id" number, "tcs_reference_id" varchar2(255), "name" varchar2(255), "type" varchar2(255), "status" varchar2(255), "risk_profile" varchar2(255), "is_username_set" number DEFAULT 0 NOT NULL, "external_status" varchar2(255), "created_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, "updated_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
|
24
|
+
}
|
25
|
+
const manager = await queryRunner.hasTable("manager");
|
26
|
+
if (!manager) {
|
27
|
+
await queryRunner.query(`CREATE TABLE "manager" ("id" number GENERATED BY DEFAULT AS IDENTITY, "username" varchar2(255), "email" varchar2(255) NOT NULL, "password" varchar2(255) NOT NULL, "first_name" varchar2(255), "last_name" varchar2(255), "phone_number" varchar2(255), "mobile_number" varchar2(255), "department" varchar2(255), "sub_department" varchar2(255), "title" varchar2(255), "role" varchar2(255) NOT NULL, "is_deleted" number, "created_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, "updated_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, CONSTRAINT "UQ_ee8fba4edb704ce2465753a2edd" UNIQUE ("email"), CONSTRAINT "PK_b3ac840005ee4ed76a7f1c51d01" PRIMARY KEY ("id"))`);
|
28
|
+
}
|
29
|
+
if (user && manager && phone_number && email && goal_plan) {
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
await queryRunner.query(`ALTER TABLE "phone_number" ADD CONSTRAINT "FK_10163df90f85bca68c3e67d090a" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
|
33
|
+
await queryRunner.query(`ALTER TABLE "email" ADD CONSTRAINT "FK_13e97b4a1d6074fd75ea1bb844e" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
|
34
|
+
await queryRunner.query(`ALTER TABLE "goal_plan" ADD CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
|
35
|
+
}
|
36
|
+
async down(queryRunner) {
|
37
|
+
await queryRunner.query(`ALTER TABLE "goal_plan" DROP CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37"`);
|
38
|
+
await queryRunner.query(`ALTER TABLE "email" DROP CONSTRAINT "FK_13e97b4a1d6074fd75ea1bb844e"`);
|
39
|
+
await queryRunner.query(`ALTER TABLE "phone_number" DROP CONSTRAINT "FK_10163df90f85bca68c3e67d090a"`);
|
40
|
+
await queryRunner.query(`DROP TABLE "manager"`);
|
41
|
+
await queryRunner.query(`DROP TABLE "user"`);
|
42
|
+
await queryRunner.query(`DROP TABLE "goal_plan"`);
|
43
|
+
await queryRunner.query(`DROP TABLE "email"`);
|
44
|
+
await queryRunner.query(`DROP TABLE "phone_number"`);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
exports.Version11740671890101 = Version11740671890101;
|
48
|
+
//# sourceMappingURL=1740671890101-version1.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1740671890101-version1.js","sourceRoot":"","sources":["../../src/migrations/1740671890101-version1.ts"],"names":[],"mappings":";;;AAEA,MAAa,qBAAqB;IAAlC;QACE,SAAI,GAAG,uBAAuB,CAAC;IAmEjC,CAAC;IAjEQ,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,WAAW,CAAC,KAAK,CACrB,uMAAuM,CACxM,CAA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AAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAChD,MAAM,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7C,MAAM,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAClD,MAAM,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC9C,MAAM,WAAW,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvD,CAAC;CACF;AApED,sDAoEC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
2
|
-
export declare class
|
2
|
+
export declare class Version21740739347863 implements MigrationInterface {
|
3
3
|
name: string;
|
4
4
|
up(queryRunner: QueryRunner): Promise<void>;
|
5
5
|
down(queryRunner: QueryRunner): Promise<void>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Version21740739347863 = void 0;
|
4
|
+
class Version21740739347863 {
|
5
|
+
constructor() {
|
6
|
+
this.name = 'Version21740739347863';
|
7
|
+
}
|
8
|
+
async up(queryRunner) {
|
9
|
+
await queryRunner.query(`CREATE TABLE "documents" ("id" number GENERATED BY DEFAULT AS IDENTITY, "reference_id" varchar2(255), "type" varchar2(255) NOT NULL, "context" varchar2(255) NOT NULL, "status" varchar2(255) NOT NULL, "hash" varchar2(255) NOT NULL, "metadata" varchar2(255) NOT NULL, "created_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, "updated_at" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, "userId" number NOT NULL, CONSTRAINT "UQ_bdd4779a41b5eae833901d1d542" UNIQUE ("hash"), CONSTRAINT "PK_ac51aa5181ee2036f5ca482857c" PRIMARY KEY ("id"))`);
|
10
|
+
await queryRunner.query(`ALTER TABLE "documents" ADD CONSTRAINT "FK_e300b5c2e3fefa9d6f8a3f25975" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
|
11
|
+
}
|
12
|
+
async down(queryRunner) {
|
13
|
+
await queryRunner.query(`ALTER TABLE "documents" DROP CONSTRAINT "FK_e300b5c2e3fefa9d6f8a3f25975"`);
|
14
|
+
await queryRunner.query(`DROP TABLE "documents"`);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
exports.Version21740739347863 = Version21740739347863;
|
18
|
+
//# sourceMappingURL=1740739347863-version2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1740739347863-version2.js","sourceRoot":"","sources":["../../src/migrations/1740739347863-version2.ts"],"names":[],"mappings":";;;AAEA,MAAa,qBAAqB;IAAlC;QACI,SAAI,GAAG,uBAAuB,CAAA;IAYlC,CAAC;IAVU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,whBAAwhB,CAAC,CAAC;QACljB,MAAM,WAAW,CAAC,KAAK,CAAC,yHAAyH,CAAC,CAAC;IACvJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QACpG,MAAM,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACtD,CAAC;CAEJ;AAbD,sDAaC"}
|