mblabs-roccato-backend-commons 1.0.7 → 1.1.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/bitbucket-pipelines.yml +6 -48
- package/dist/database/entities/account.d.ts +1 -2
- package/dist/database/entities/account.js +2 -7
- package/dist/database/entities/address.d.ts +2 -1
- package/dist/database/entities/address.js +6 -5
- package/dist/database/entities/company-address.d.ts +2 -0
- package/dist/database/entities/company-address.js +7 -0
- package/dist/database/migrations/1748448589934-CreateAccountsTable.js +1 -6
- package/dist/database/migrations/1750432386920-CreateAddressTable.js +0 -5
- package/dist/database/migrations/index.js +0 -4
- package/dist/interfaces/aws.d.ts +41 -67
- package/dist/interfaces/azure.d.ts +38 -61
- package/dist/interfaces/firebase.d.ts +3 -7
- package/dist/interfaces/gcp.d.ts +5 -11
- package/dist/interfaces/grafana.d.ts +2 -6
- package/dist/interfaces/keycloak.d.ts +4 -171
- package/dist/interfaces/nodemailer.d.ts +16 -20
- package/dist/interfaces/redis.d.ts +8 -49
- package/dist/interfaces/sendgrid.d.ts +13 -15
- package/dist/services/aws/cloudwatch.d.ts +1 -1
- package/dist/services/aws/cloudwatch.js +38 -38
- package/dist/services/aws/pinpoint.d.ts +3 -3
- package/dist/services/aws/pinpoint.js +29 -29
- package/dist/services/aws/s3.d.ts +5 -5
- package/dist/services/aws/s3.js +55 -59
- package/dist/services/aws/secret-manager.d.ts +1 -1
- package/dist/services/aws/secret-manager.js +5 -5
- package/dist/services/aws/sqs.d.ts +3 -3
- package/dist/services/aws/sqs.js +16 -16
- package/dist/services/azure/application-insights.d.ts +4 -4
- package/dist/services/azure/application-insights.js +12 -12
- package/dist/services/azure/communication.d.ts +3 -3
- package/dist/services/azure/communication.js +17 -17
- package/dist/services/azure/keyvault.d.ts +1 -1
- package/dist/services/azure/keyvault.js +3 -3
- package/dist/services/azure/storage-blob.d.ts +3 -3
- package/dist/services/azure/storage-blob.js +22 -22
- package/dist/services/firebase.d.ts +2 -2
- package/dist/services/firebase.js +10 -12
- package/dist/services/gcp/drive.d.ts +1 -1
- package/dist/services/gcp/drive.js +4 -4
- package/dist/services/gcp/secrets.d.ts +1 -1
- package/dist/services/gcp/secrets.js +8 -6
- package/dist/services/gcp/sheets.d.ts +1 -1
- package/dist/services/gcp/sheets.js +6 -6
- package/dist/services/grafana.d.ts +2 -2
- package/dist/services/grafana.js +12 -12
- package/dist/services/keycloak.d.ts +2 -14
- package/dist/services/keycloak.js +24 -300
- package/dist/services/nodemailer.d.ts +2 -2
- package/dist/services/nodemailer.js +109 -19
- package/dist/services/redis.d.ts +8 -6
- package/dist/services/redis.js +24 -53
- package/dist/services/sendgrid.d.ts +1 -1
- package/dist/services/sendgrid.js +10 -10
- package/package.json +1 -1
- package/src/database/entities/account.ts +3 -5
- package/src/database/entities/address.ts +7 -4
- package/src/database/entities/company-address.ts +5 -0
- package/src/database/migrations/1748448589934-CreateAccountsTable.ts +1 -6
- package/src/database/migrations/1750432386920-CreateAddressTable.ts +0 -5
- package/src/database/migrations/index.ts +0 -4
- package/src/interfaces/aws.ts +55 -81
- package/src/interfaces/azure.ts +50 -71
- package/src/interfaces/firebase.ts +6 -10
- package/src/interfaces/gcp.ts +8 -14
- package/src/interfaces/grafana.ts +5 -9
- package/src/interfaces/keycloak.ts +7 -190
- package/src/interfaces/nodemailer.ts +18 -22
- package/src/interfaces/redis.ts +8 -54
- package/src/interfaces/sendgrid.ts +14 -16
- package/src/services/aws/cloudwatch.ts +39 -39
- package/src/services/aws/pinpoint.ts +30 -30
- package/src/services/aws/s3.ts +55 -59
- package/src/services/aws/secret-manager.ts +7 -8
- package/src/services/aws/sqs.ts +17 -23
- package/src/services/azure/application-insights.ts +12 -12
- package/src/services/azure/communication.ts +18 -18
- package/src/services/azure/keyvault.ts +3 -3
- package/src/services/azure/storage-blob.ts +30 -34
- package/src/services/firebase.ts +11 -21
- package/src/services/gcp/drive.ts +5 -8
- package/src/services/gcp/secrets.ts +10 -9
- package/src/services/gcp/sheets.ts +7 -10
- package/src/services/grafana.ts +12 -18
- package/src/services/keycloak.ts +25 -381
- package/src/services/nodemailer.ts +110 -19
- package/src/services/redis.ts +22 -58
- package/src/services/sendgrid.ts +11 -11
- package/dist/database/migrations/1750690818577-CreateAccountAddressTable.d.ts +0 -5
- package/dist/database/migrations/1750690818577-CreateAccountAddressTable.js +0 -94
- package/dist/database/migrations/1750691840822-CreateAccountDetailsTable.d.ts +0 -5
- package/dist/database/migrations/1750691840822-CreateAccountDetailsTable.js +0 -99
- package/src/database/migrations/1750690818577-CreateAccountAddressTable.ts +0 -98
- package/src/database/migrations/1750691840822-CreateAccountDetailsTable.ts +0 -99
package/src/services/sendgrid.ts
CHANGED
|
@@ -3,20 +3,20 @@ import instance from '@sendgrid/mail';
|
|
|
3
3
|
import { ISendgridService, Sendgrid } from '../interfaces/sendgrid';
|
|
4
4
|
|
|
5
5
|
class SendgridService implements ISendgridService {
|
|
6
|
-
async sendMail (
|
|
7
|
-
instance.setApiKey(credentials.apiKey);
|
|
6
|
+
async sendMail (req: Sendgrid.SendMail.Request): Promise<void> {
|
|
7
|
+
instance.setApiKey(req.credentials.apiKey);
|
|
8
8
|
|
|
9
9
|
await instance.send({
|
|
10
|
-
from:
|
|
11
|
-
to:
|
|
12
|
-
subject:
|
|
13
|
-
text:
|
|
14
|
-
html:
|
|
15
|
-
templateId:
|
|
16
|
-
attachments:
|
|
17
|
-
dynamicTemplateData:
|
|
10
|
+
from: req.from,
|
|
11
|
+
to: req.to,
|
|
12
|
+
subject: req.subject,
|
|
13
|
+
text: req.text,
|
|
14
|
+
html: req.html,
|
|
15
|
+
templateId: req.template,
|
|
16
|
+
attachments: req.attachments,
|
|
17
|
+
dynamicTemplateData: req.substitutions,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export default new SendgridService();
|
|
22
|
+
export default new SendgridService();
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CreateAccountAddressTable1750690818577 = void 0;
|
|
7
|
-
const typeorm_1 = require("typeorm");
|
|
8
|
-
const utils_1 = __importDefault(require("../utils"));
|
|
9
|
-
class CreateAccountAddressTable1750690818577 {
|
|
10
|
-
async up(queryRunner) {
|
|
11
|
-
const hasTable = await utils_1.default.checkHasTable('account_address', queryRunner);
|
|
12
|
-
if (hasTable)
|
|
13
|
-
return;
|
|
14
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
|
15
|
-
name: 'account_address',
|
|
16
|
-
columns: [
|
|
17
|
-
{
|
|
18
|
-
name: 'id',
|
|
19
|
-
type: 'uuid',
|
|
20
|
-
isPrimary: true,
|
|
21
|
-
generationStrategy: 'uuid',
|
|
22
|
-
default: 'uuid_generate_v4()',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'accountId',
|
|
26
|
-
type: 'uuid',
|
|
27
|
-
isNullable: false,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'addressId',
|
|
31
|
-
type: 'uuid',
|
|
32
|
-
isNullable: false,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'createdBy',
|
|
36
|
-
type: 'varchar',
|
|
37
|
-
isNullable: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'createdAt',
|
|
41
|
-
type: 'timestamptz',
|
|
42
|
-
default: 'now()',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'updatedBy',
|
|
46
|
-
type: 'varchar',
|
|
47
|
-
isNullable: true,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'updatedAt',
|
|
51
|
-
type: 'timestamptz',
|
|
52
|
-
default: 'now()',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'deletedBy',
|
|
56
|
-
type: 'varchar',
|
|
57
|
-
isNullable: true,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'deletedAt',
|
|
61
|
-
type: 'timestamptz',
|
|
62
|
-
isNullable: true,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
foreignKeys: [
|
|
66
|
-
{
|
|
67
|
-
columnNames: ['accountId'],
|
|
68
|
-
referencedColumnNames: ['id'],
|
|
69
|
-
referencedTableName: 'account',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
columnNames: ['addressId'],
|
|
73
|
-
referencedColumnNames: ['id'],
|
|
74
|
-
referencedTableName: 'address',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
indices: [
|
|
78
|
-
new typeorm_1.TableIndex({
|
|
79
|
-
name: 'IDX_ACCOUNT_ADDRESS',
|
|
80
|
-
columnNames: ['id', 'accountId', 'addressId'],
|
|
81
|
-
}),
|
|
82
|
-
],
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
async down(queryRunner) {
|
|
86
|
-
const hasTable = await utils_1.default.checkHasTable('account_address', queryRunner);
|
|
87
|
-
if (!hasTable)
|
|
88
|
-
return;
|
|
89
|
-
await utils_1.default.dropTableForeignKeys('account_address', ['accountId', 'addressId'], queryRunner);
|
|
90
|
-
await utils_1.default.dropIndex('account_address', 'IDX_ACCOUNT_ADDRESS', queryRunner);
|
|
91
|
-
await queryRunner.dropTable('account_address');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.CreateAccountAddressTable1750690818577 = CreateAccountAddressTable1750690818577;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CreateAccountDetailsTable1750691840822 = void 0;
|
|
7
|
-
const typeorm_1 = require("typeorm");
|
|
8
|
-
const utils_1 = __importDefault(require("../utils"));
|
|
9
|
-
class CreateAccountDetailsTable1750691840822 {
|
|
10
|
-
async up(queryRunner) {
|
|
11
|
-
const hasTable = await utils_1.default.checkHasTable('account_details', queryRunner);
|
|
12
|
-
if (hasTable)
|
|
13
|
-
return;
|
|
14
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
|
15
|
-
name: 'account_details',
|
|
16
|
-
columns: [
|
|
17
|
-
{
|
|
18
|
-
name: 'id',
|
|
19
|
-
type: 'uuid',
|
|
20
|
-
isPrimary: true,
|
|
21
|
-
generationStrategy: 'uuid',
|
|
22
|
-
default: 'uuid_generate_v4()',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'accountId',
|
|
26
|
-
type: 'uuid',
|
|
27
|
-
isNullable: true,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'position',
|
|
31
|
-
type: 'varchar',
|
|
32
|
-
isNullable: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'immediateSuperior',
|
|
36
|
-
type: 'varchar',
|
|
37
|
-
isNullable: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'photo',
|
|
41
|
-
type: 'varchar',
|
|
42
|
-
isNullable: true,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'createdBy',
|
|
46
|
-
type: 'varchar',
|
|
47
|
-
isNullable: true,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'createdAt',
|
|
51
|
-
type: 'timestamptz',
|
|
52
|
-
default: 'now()',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'updatedBy',
|
|
56
|
-
type: 'varchar',
|
|
57
|
-
isNullable: true,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'updatedAt',
|
|
61
|
-
type: 'timestamptz',
|
|
62
|
-
default: 'now()',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'deletedBy',
|
|
66
|
-
type: 'varchar',
|
|
67
|
-
isNullable: true,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'deletedAt',
|
|
71
|
-
type: 'timestamptz',
|
|
72
|
-
isNullable: true,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
foreignKeys: [
|
|
76
|
-
{
|
|
77
|
-
columnNames: ['accountId'],
|
|
78
|
-
referencedTableName: 'account',
|
|
79
|
-
referencedColumnNames: ['id'],
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
indices: [
|
|
83
|
-
new typeorm_1.TableIndex({
|
|
84
|
-
name: 'IDX_ACCOUNT_DETAILS',
|
|
85
|
-
columnNames: ['id', 'accountId', 'position', 'immediateSuperior'],
|
|
86
|
-
}),
|
|
87
|
-
],
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
async down(queryRunner) {
|
|
91
|
-
const hasTable = await utils_1.default.checkHasTable('account_details', queryRunner);
|
|
92
|
-
if (!hasTable)
|
|
93
|
-
return;
|
|
94
|
-
await utils_1.default.dropTableForeignKeys('account_details', ['accountId'], queryRunner);
|
|
95
|
-
await utils_1.default.dropIndex('account_details', 'IDX_ACCOUNT_DETAILS', queryRunner);
|
|
96
|
-
await queryRunner.dropTable('account_details');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.CreateAccountDetailsTable1750691840822 = CreateAccountDetailsTable1750691840822;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner, Table, TableIndex } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
import DatabaseUtils from '../utils';
|
|
4
|
-
|
|
5
|
-
export class CreateAccountAddressTable1750690818577 implements MigrationInterface {
|
|
6
|
-
public async up (queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
const hasTable = await DatabaseUtils.checkHasTable('account_address', queryRunner);
|
|
8
|
-
|
|
9
|
-
if (hasTable) return;
|
|
10
|
-
|
|
11
|
-
await queryRunner.createTable(
|
|
12
|
-
new Table({
|
|
13
|
-
name: 'account_address',
|
|
14
|
-
columns: [
|
|
15
|
-
{
|
|
16
|
-
name: 'id',
|
|
17
|
-
type: 'uuid',
|
|
18
|
-
isPrimary: true,
|
|
19
|
-
generationStrategy: 'uuid',
|
|
20
|
-
default: 'uuid_generate_v4()',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'accountId',
|
|
24
|
-
type: 'uuid',
|
|
25
|
-
isNullable: false,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'addressId',
|
|
29
|
-
type: 'uuid',
|
|
30
|
-
isNullable: false,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'createdBy',
|
|
34
|
-
type: 'varchar',
|
|
35
|
-
isNullable: true,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'createdAt',
|
|
39
|
-
type: 'timestamptz',
|
|
40
|
-
default: 'now()',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'updatedBy',
|
|
44
|
-
type: 'varchar',
|
|
45
|
-
isNullable: true,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'updatedAt',
|
|
49
|
-
type: 'timestamptz',
|
|
50
|
-
default: 'now()',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'deletedBy',
|
|
54
|
-
type: 'varchar',
|
|
55
|
-
isNullable: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'deletedAt',
|
|
59
|
-
type: 'timestamptz',
|
|
60
|
-
isNullable: true,
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
foreignKeys: [
|
|
64
|
-
{
|
|
65
|
-
columnNames: [ 'accountId' ],
|
|
66
|
-
referencedColumnNames: [ 'id' ],
|
|
67
|
-
referencedTableName: 'account',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
columnNames: [ 'addressId' ],
|
|
71
|
-
referencedColumnNames: [ 'id' ],
|
|
72
|
-
referencedTableName: 'address',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
indices: [
|
|
76
|
-
new TableIndex({
|
|
77
|
-
name: 'IDX_ACCOUNT_ADDRESS',
|
|
78
|
-
columnNames: [ 'id', 'accountId', 'addressId' ],
|
|
79
|
-
}),
|
|
80
|
-
],
|
|
81
|
-
})
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public async down (queryRunner: QueryRunner): Promise<void> {
|
|
86
|
-
const hasTable = await DatabaseUtils.checkHasTable('account_address', queryRunner);
|
|
87
|
-
|
|
88
|
-
if (!hasTable) return;
|
|
89
|
-
|
|
90
|
-
await DatabaseUtils.dropTableForeignKeys(
|
|
91
|
-
'account_address',
|
|
92
|
-
[ 'accountId', 'addressId' ],
|
|
93
|
-
queryRunner
|
|
94
|
-
);
|
|
95
|
-
await DatabaseUtils.dropIndex('account_address', 'IDX_ACCOUNT_ADDRESS', queryRunner);
|
|
96
|
-
await queryRunner.dropTable('account_address');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner, Table, TableIndex } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
import DatabaseUtils from '../utils';
|
|
4
|
-
|
|
5
|
-
export class CreateAccountDetailsTable1750691840822 implements MigrationInterface {
|
|
6
|
-
public async up (queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
const hasTable = await DatabaseUtils.checkHasTable('account_details', queryRunner);
|
|
8
|
-
|
|
9
|
-
if (hasTable) return;
|
|
10
|
-
|
|
11
|
-
await queryRunner.createTable(
|
|
12
|
-
new Table({
|
|
13
|
-
name: 'account_details',
|
|
14
|
-
columns: [
|
|
15
|
-
{
|
|
16
|
-
name: 'id',
|
|
17
|
-
type: 'uuid',
|
|
18
|
-
isPrimary: true,
|
|
19
|
-
generationStrategy: 'uuid',
|
|
20
|
-
default: 'uuid_generate_v4()',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'accountId',
|
|
24
|
-
type: 'uuid',
|
|
25
|
-
isNullable: true,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'position',
|
|
29
|
-
type: 'varchar',
|
|
30
|
-
isNullable: true,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'immediateSuperior',
|
|
34
|
-
type: 'varchar',
|
|
35
|
-
isNullable: true,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'photo',
|
|
39
|
-
type: 'varchar',
|
|
40
|
-
isNullable: true,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'createdBy',
|
|
44
|
-
type: 'varchar',
|
|
45
|
-
isNullable: true,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'createdAt',
|
|
49
|
-
type: 'timestamptz',
|
|
50
|
-
default: 'now()',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'updatedBy',
|
|
54
|
-
type: 'varchar',
|
|
55
|
-
isNullable: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'updatedAt',
|
|
59
|
-
type: 'timestamptz',
|
|
60
|
-
default: 'now()',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'deletedBy',
|
|
64
|
-
type: 'varchar',
|
|
65
|
-
isNullable: true,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'deletedAt',
|
|
69
|
-
type: 'timestamptz',
|
|
70
|
-
isNullable: true,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
foreignKeys: [
|
|
74
|
-
{
|
|
75
|
-
columnNames: [ 'accountId' ],
|
|
76
|
-
referencedTableName: 'account',
|
|
77
|
-
referencedColumnNames: [ 'id' ],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
indices: [
|
|
81
|
-
new TableIndex({
|
|
82
|
-
name: 'IDX_ACCOUNT_DETAILS',
|
|
83
|
-
columnNames: [ 'id', 'accountId', 'position', 'immediateSuperior' ],
|
|
84
|
-
}),
|
|
85
|
-
],
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public async down (queryRunner: QueryRunner): Promise<void> {
|
|
91
|
-
const hasTable = await DatabaseUtils.checkHasTable('account_details', queryRunner);
|
|
92
|
-
|
|
93
|
-
if (!hasTable) return;
|
|
94
|
-
|
|
95
|
-
await DatabaseUtils.dropTableForeignKeys('account_details', [ 'accountId' ], queryRunner);
|
|
96
|
-
await DatabaseUtils.dropIndex('account_details', 'IDX_ACCOUNT_DETAILS', queryRunner);
|
|
97
|
-
await queryRunner.dropTable('account_details');
|
|
98
|
-
}
|
|
99
|
-
}
|