@hedhog/admin 0.0.81 → 0.0.83
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__migrations/migrate-01.d.ts +6 -0
- package/dist/__migrations/migrate-01.d.ts.map +1 -0
- package/dist/__migrations/migrate-01.js +80 -0
- package/dist/__migrations/migrate-01.js.map +1 -0
- package/dist/__migrations/migrate-02.d.ts +6 -0
- package/dist/__migrations/migrate-02.d.ts.map +1 -0
- package/dist/__migrations/migrate-02.js +68 -0
- package/dist/__migrations/migrate-02.js.map +1 -0
- package/dist/__migrations/migrate-03.d.ts +6 -0
- package/dist/__migrations/migrate-03.d.ts.map +1 -0
- package/dist/__migrations/migrate-03.js +90 -0
- package/dist/__migrations/migrate-03.js.map +1 -0
- package/dist/__migrations/migrate-04.d.ts +6 -0
- package/dist/__migrations/migrate-04.d.ts.map +1 -0
- package/dist/__migrations/migrate-04.js +63 -0
- package/dist/__migrations/migrate-04.js.map +1 -0
- package/dist/__migrations/migrate-05.d.ts +6 -0
- package/dist/__migrations/migrate-05.d.ts.map +1 -0
- package/dist/__migrations/migrate-05.js +100 -0
- package/dist/__migrations/migrate-05.js.map +1 -0
- package/dist/__migrations/migrate-06.d.ts +6 -0
- package/dist/__migrations/migrate-06.d.ts.map +1 -0
- package/dist/__migrations/migrate-06.js +37 -0
- package/dist/__migrations/migrate-06.js.map +1 -0
- package/dist/__migrations/migrate-07.d.ts +6 -0
- package/dist/__migrations/migrate-07.d.ts.map +1 -0
- package/dist/__migrations/migrate-07.js +59 -0
- package/dist/__migrations/migrate-07.js.map +1 -0
- package/dist/__migrations/migrate-08.d.ts +6 -0
- package/dist/__migrations/migrate-08.d.ts.map +1 -0
- package/dist/__migrations/migrate-08.js +39 -0
- package/dist/__migrations/migrate-08.js.map +1 -0
- package/dist/__migrations/migrate-09.d.ts +6 -0
- package/dist/__migrations/migrate-09.d.ts.map +1 -0
- package/dist/__migrations/migrate-09.js +39 -0
- package/dist/__migrations/migrate-09.js.map +1 -0
- package/dist/__migrations/migrate-10.d.ts +6 -0
- package/dist/__migrations/migrate-10.d.ts.map +1 -0
- package/dist/__migrations/migrate-10.js +39 -0
- package/dist/__migrations/migrate-10.js.map +1 -0
- package/dist/__migrations/migrate-11.d.ts +6 -0
- package/dist/__migrations/migrate-11.d.ts.map +1 -0
- package/dist/__migrations/migrate-11.js +39 -0
- package/dist/__migrations/migrate-11.js.map +1 -0
- package/dist/__migrations/migrate-12.d.ts +6 -0
- package/dist/__migrations/migrate-12.d.ts.map +1 -0
- package/dist/__migrations/migrate-12.js +39 -0
- package/dist/__migrations/migrate-12.js.map +1 -0
- package/dist/__migrations/migrate-13.d.ts +6 -0
- package/dist/__migrations/migrate-13.d.ts.map +1 -0
- package/dist/__migrations/migrate-13.js +30 -0
- package/dist/__migrations/migrate-13.js.map +1 -0
- package/dist/__migrations/migrate-14.d.ts +6 -0
- package/dist/__migrations/migrate-14.d.ts.map +1 -0
- package/dist/__migrations/migrate-14.js +83 -0
- package/dist/__migrations/migrate-14.js.map +1 -0
- package/dist/__migrations/migrate-15.d.ts +6 -0
- package/dist/__migrations/migrate-15.d.ts.map +1 -0
- package/dist/__migrations/migrate-15.js +25 -0
- package/dist/__migrations/migrate-15.js.map +1 -0
- package/dist/__migrations/migrate-16.d.ts +6 -0
- package/dist/__migrations/migrate-16.d.ts.map +1 -0
- package/dist/__migrations/migrate-16.js +61 -0
- package/dist/__migrations/migrate-16.js.map +1 -0
- package/dist/__migrations/migrate-17.d.ts +6 -0
- package/dist/__migrations/migrate-17.d.ts.map +1 -0
- package/dist/__migrations/migrate-17.js +31 -0
- package/dist/__migrations/migrate-17.js.map +1 -0
- package/dist/__migrations/migrate-18.d.ts +6 -0
- package/dist/__migrations/migrate-18.d.ts.map +1 -0
- package/dist/__migrations/migrate-18.js +41 -0
- package/dist/__migrations/migrate-18.js.map +1 -0
- package/dist/__migrations/migrate-19.d.ts +6 -0
- package/dist/__migrations/migrate-19.d.ts.map +1 -0
- package/dist/__migrations/migrate-19.js +175 -0
- package/dist/__migrations/migrate-19.js.map +1 -0
- package/dist/__migrations/migrate-20.d.ts +6 -0
- package/dist/__migrations/migrate-20.d.ts.map +1 -0
- package/dist/__migrations/migrate-20.js +310 -0
- package/dist/__migrations/migrate-20.js.map +1 -0
- package/hedhog.yaml +487 -0
- package/package.json +1 -1
- package/src/migrations/migrate-01.ts +0 -86
- package/src/migrations/migrate-02.ts +0 -77
- package/src/migrations/migrate-03.ts +0 -102
- package/src/migrations/migrate-04.ts +0 -71
- package/src/migrations/migrate-05.ts +0 -119
- package/src/migrations/migrate-06.ts +0 -37
- package/src/migrations/migrate-07.ts +0 -66
- package/src/migrations/migrate-08.ts +0 -44
- package/src/migrations/migrate-09.ts +0 -44
- package/src/migrations/migrate-10.ts +0 -44
- package/src/migrations/migrate-11.ts +0 -45
- package/src/migrations/migrate-12.ts +0 -44
- package/src/migrations/migrate-13.ts +0 -28
- package/src/migrations/migrate-14.ts +0 -81
- package/src/migrations/migrate-15.ts +0 -23
- package/src/migrations/migrate-16.ts +0 -59
- package/src/migrations/migrate-17.ts +0 -29
- package/src/migrations/migrate-18.ts +0 -39
- package/src/migrations/migrate-19.ts +0 -186
- package/src/migrations/migrate-20.ts +0 -308
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-01.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-01.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAS,MAAM,SAAS,CAAC;AAGjE,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8E3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'countries',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'code',
|
14
|
+
type: 'char',
|
15
|
+
length: '3',
|
16
|
+
isNullable: false,
|
17
|
+
},
|
18
|
+
(0, utils_1.timestampColumn)(),
|
19
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
20
|
+
],
|
21
|
+
}), true);
|
22
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
23
|
+
name: 'locales',
|
24
|
+
columns: [
|
25
|
+
(0, utils_1.idColumn)(),
|
26
|
+
{
|
27
|
+
name: 'code',
|
28
|
+
type: 'char',
|
29
|
+
length: '2',
|
30
|
+
isNullable: false,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
name: 'region',
|
34
|
+
type: 'char',
|
35
|
+
length: '2',
|
36
|
+
isNullable: false,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: 'enabled',
|
40
|
+
type: 'boolean',
|
41
|
+
default: true,
|
42
|
+
},
|
43
|
+
(0, utils_1.timestampColumn)(),
|
44
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
45
|
+
],
|
46
|
+
}));
|
47
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
48
|
+
name: 'country_translations',
|
49
|
+
columns: [
|
50
|
+
(0, utils_1.foreignColumn)({ name: 'country_id', isPrimary: true }),
|
51
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
52
|
+
{
|
53
|
+
name: 'name',
|
54
|
+
type: 'varchar',
|
55
|
+
},
|
56
|
+
(0, utils_1.timestampColumn)(),
|
57
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
58
|
+
],
|
59
|
+
foreignKeys: [
|
60
|
+
{
|
61
|
+
columnNames: ['country_id'],
|
62
|
+
referencedColumnNames: ['id'],
|
63
|
+
referencedTableName: 'countries',
|
64
|
+
onDelete: 'CASCADE',
|
65
|
+
},
|
66
|
+
{
|
67
|
+
columnNames: ['locale_id'],
|
68
|
+
referencedColumnNames: ['id'],
|
69
|
+
referencedTableName: 'locales',
|
70
|
+
onDelete: 'CASCADE',
|
71
|
+
},
|
72
|
+
],
|
73
|
+
}));
|
74
|
+
}
|
75
|
+
async down(queryRunner) {
|
76
|
+
await queryRunner.dropTable('locales');
|
77
|
+
}
|
78
|
+
}
|
79
|
+
exports.Migrate = Migrate;
|
80
|
+
//# sourceMappingURL=migrate-01.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-01.js","sourceRoot":"","sources":["../../src/__migrations/migrate-01.ts"],"names":[],"mappings":";;;AAAA,qCAAiE;AACjE,yCAAyE;AAEzE,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,KAAK;iBAClB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,EACF,IAAI,CACL,CAAC;QAEF,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,KAAK;iBA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AAGjB,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA+D3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'translation_namespaces',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'name',
|
14
|
+
type: 'varchar',
|
15
|
+
isNullable: false,
|
16
|
+
},
|
17
|
+
(0, utils_1.timestampColumn)(),
|
18
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
19
|
+
],
|
20
|
+
}), true);
|
21
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
22
|
+
name: 'translations',
|
23
|
+
columns: [
|
24
|
+
(0, utils_1.idColumn)(),
|
25
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id' }),
|
26
|
+
(0, utils_1.foreignColumn)({ name: 'namespace_id' }),
|
27
|
+
{
|
28
|
+
name: 'name',
|
29
|
+
type: 'varchar',
|
30
|
+
isNullable: false,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
name: 'value',
|
34
|
+
type: 'varchar',
|
35
|
+
isNullable: false,
|
36
|
+
},
|
37
|
+
(0, utils_1.timestampColumn)(),
|
38
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
39
|
+
],
|
40
|
+
indices: [
|
41
|
+
{
|
42
|
+
columnNames: ['locale_id', 'namespace_id', 'name'],
|
43
|
+
isUnique: true,
|
44
|
+
},
|
45
|
+
],
|
46
|
+
foreignKeys: [
|
47
|
+
new typeorm_1.TableForeignKey({
|
48
|
+
columnNames: ['locale_id'],
|
49
|
+
referencedTableName: 'locales',
|
50
|
+
referencedColumnNames: ['id'],
|
51
|
+
onDelete: 'CASCADE',
|
52
|
+
}),
|
53
|
+
new typeorm_1.TableForeignKey({
|
54
|
+
columnNames: ['namespace_id'],
|
55
|
+
referencedTableName: 'translation_namespaces',
|
56
|
+
referencedColumnNames: ['id'],
|
57
|
+
onDelete: 'CASCADE',
|
58
|
+
}),
|
59
|
+
],
|
60
|
+
}), true);
|
61
|
+
}
|
62
|
+
async down(queryRunner) {
|
63
|
+
await queryRunner.dropTable('translations');
|
64
|
+
await queryRunner.dropTable('translation_namespaces');
|
65
|
+
}
|
66
|
+
}
|
67
|
+
exports.Migrate = Migrate;
|
68
|
+
//# sourceMappingURL=migrate-02.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-02.js","sourceRoot":"","sources":["../../src/__migrations/migrate-02.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,yCAAyE;AAEzE,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,MAAM,WAAW,CAAC,WAAW,CACjC,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,KAAK;iBAClB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,EACF,IAAI,CACL,CAAC;QAEF,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;gBACpC,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AAE,CAAC,WAAW,EAAE,WAAW;IAwF3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAIpC"}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'multifactors',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'slug',
|
14
|
+
type: 'varchar',
|
15
|
+
isUnique: true,
|
16
|
+
},
|
17
|
+
(0, utils_1.timestampColumn)(),
|
18
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
19
|
+
],
|
20
|
+
}), true);
|
21
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
22
|
+
name: 'multifactor_translations',
|
23
|
+
columns: [
|
24
|
+
(0, utils_1.foreignColumn)({ name: 'multifactor_id', isPrimary: true }),
|
25
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
26
|
+
{
|
27
|
+
name: 'name',
|
28
|
+
type: 'varchar',
|
29
|
+
},
|
30
|
+
(0, utils_1.timestampColumn)(),
|
31
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
32
|
+
],
|
33
|
+
foreignKeys: [
|
34
|
+
new typeorm_1.TableForeignKey({
|
35
|
+
columnNames: ['multifactor_id'],
|
36
|
+
referencedTableName: 'multifactors',
|
37
|
+
referencedColumnNames: ['id'],
|
38
|
+
onDelete: 'CASCADE',
|
39
|
+
}),
|
40
|
+
new typeorm_1.TableForeignKey({
|
41
|
+
columnNames: ['locale_id'],
|
42
|
+
referencedTableName: 'locales',
|
43
|
+
referencedColumnNames: ['id'],
|
44
|
+
onDelete: 'CASCADE',
|
45
|
+
}),
|
46
|
+
],
|
47
|
+
}), true);
|
48
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
49
|
+
name: 'users',
|
50
|
+
columns: [
|
51
|
+
(0, utils_1.idColumn)(),
|
52
|
+
(0, utils_1.foreignColumn)({ name: 'multifactor_id', isNullable: true }),
|
53
|
+
{
|
54
|
+
name: 'name',
|
55
|
+
type: 'varchar',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
name: 'email',
|
59
|
+
type: 'varchar',
|
60
|
+
},
|
61
|
+
{
|
62
|
+
name: 'password',
|
63
|
+
type: 'varchar',
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'code',
|
67
|
+
type: 'varchar',
|
68
|
+
isNullable: true,
|
69
|
+
},
|
70
|
+
(0, utils_1.timestampColumn)(),
|
71
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
72
|
+
],
|
73
|
+
}));
|
74
|
+
await queryRunner.createForeignKeys('users', [
|
75
|
+
new typeorm_1.TableForeignKey({
|
76
|
+
columnNames: ['multifactor_id'],
|
77
|
+
referencedColumnNames: ['id'],
|
78
|
+
referencedTableName: 'multifactors',
|
79
|
+
name: 'fk_users_to_multifactors_on_multifactor_id',
|
80
|
+
onDelete: 'Cascade',
|
81
|
+
}),
|
82
|
+
]);
|
83
|
+
}
|
84
|
+
async down(queryRunner) {
|
85
|
+
await queryRunner.dropTable('multifactors');
|
86
|
+
await queryRunner.dropTable('users');
|
87
|
+
}
|
88
|
+
}
|
89
|
+
exports.Migrate = Migrate;
|
90
|
+
//# sourceMappingURL=migrate-03.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-03.js","sourceRoot":"","sources":["../../src/__migrations/migrate-03.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,yCAAyE;AAEzE,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,cAAc;YACpB,O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AI,EAAE,CAAC;gBAC3D;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;iBACjB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,MAAM,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE;YAC3C,IAAI,yBAAe,CAAC;gBAClB,WAAW,EAAE,CAAC,gBAAgB,CAAC;gBAC/B,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,cAAc;gBACnC,IAAI,EAAE,4CAA4C;gBAClD,QAAQ,EAAE,SAAS;aACpB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC5C,MAAM,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AA7FD,0BA6FC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-04.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-04.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAyD3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const utils_1 = require("@hedhog/utils");
|
5
|
+
const typeorm_1 = require("typeorm");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'screens',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'slug',
|
14
|
+
type: 'varchar',
|
15
|
+
isUnique: true,
|
16
|
+
},
|
17
|
+
{
|
18
|
+
name: 'icon',
|
19
|
+
type: 'varchar',
|
20
|
+
isNullable: true,
|
21
|
+
},
|
22
|
+
(0, utils_1.timestampColumn)(),
|
23
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
24
|
+
],
|
25
|
+
}));
|
26
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
27
|
+
name: 'screen_translations',
|
28
|
+
columns: [
|
29
|
+
(0, utils_1.foreignColumn)({ name: 'screen_id', isPrimary: true }),
|
30
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
31
|
+
{
|
32
|
+
name: 'name',
|
33
|
+
type: 'varchar',
|
34
|
+
},
|
35
|
+
{
|
36
|
+
name: 'description',
|
37
|
+
type: 'varchar',
|
38
|
+
},
|
39
|
+
(0, utils_1.timestampColumn)(),
|
40
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
41
|
+
],
|
42
|
+
foreignKeys: [
|
43
|
+
new typeorm_1.TableForeignKey({
|
44
|
+
columnNames: ['screen_id'],
|
45
|
+
referencedTableName: 'screens',
|
46
|
+
referencedColumnNames: ['id'],
|
47
|
+
onDelete: 'CASCADE',
|
48
|
+
}),
|
49
|
+
new typeorm_1.TableForeignKey({
|
50
|
+
columnNames: ['locale_id'],
|
51
|
+
referencedTableName: 'locales',
|
52
|
+
referencedColumnNames: ['id'],
|
53
|
+
onDelete: 'CASCADE',
|
54
|
+
}),
|
55
|
+
],
|
56
|
+
}));
|
57
|
+
}
|
58
|
+
async down(queryRunner) {
|
59
|
+
await queryRunner.dropTable('screens');
|
60
|
+
}
|
61
|
+
}
|
62
|
+
exports.Migrate = Migrate;
|
63
|
+
//# sourceMappingURL=migrate-04.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-04.js","sourceRoot":"","sources":["../../src/__migrations/migrate-04.ts"],"names":[],"mappings":";;;AAAA,yCAAyE;AAEzE,qCAKiB;AAEjB,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;iBACjB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE;gBACP,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACrD,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACrD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,SAAS;iBAChB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;YACD,WAAW,EAAE;gBACX,IAAI,yBAAe,CAAC;oBAClB,WAAW,EAAE,CAAC,WAAW,CAAC;oBAC1B,mBAAmB,EAAE,SAAS;oBAC9B,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,SAAS;iBACpB,CAAC;gBACF,IAAI,yBAAe,CAAC;oBAClB,WAAW,EAAE,CAAC,WAAW,CAAC;oBAC1B,mBAAmB,EAAE,SAAS;oBAC9B,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,SAAS;iBACpB,CAAC;aACH;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AA7DD,0BA6DC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-05.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-05.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAGjB,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAwG3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'menus',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
(0, utils_1.foreignColumn)({ name: 'menu_id', isNullable: true }),
|
13
|
+
{
|
14
|
+
name: 'slug',
|
15
|
+
type: 'varchar',
|
16
|
+
isUnique: true,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
name: 'url',
|
20
|
+
type: 'varchar',
|
21
|
+
isNullable: true,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
name: 'order',
|
25
|
+
type: 'int',
|
26
|
+
default: 0,
|
27
|
+
unsigned: true,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: 'icon',
|
31
|
+
type: 'varchar',
|
32
|
+
isNullable: true,
|
33
|
+
},
|
34
|
+
(0, utils_1.timestampColumn)(),
|
35
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
36
|
+
],
|
37
|
+
indices: [{ columnNames: ['slug'], isUnique: true }],
|
38
|
+
foreignKeys: [
|
39
|
+
{
|
40
|
+
columnNames: ['menu_id'],
|
41
|
+
referencedColumnNames: ['id'],
|
42
|
+
referencedTableName: 'menus',
|
43
|
+
onDelete: 'CASCADE',
|
44
|
+
},
|
45
|
+
],
|
46
|
+
}));
|
47
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
48
|
+
name: 'menu_translations',
|
49
|
+
columns: [
|
50
|
+
(0, utils_1.foreignColumn)({ name: 'menu_id', isPrimary: true }),
|
51
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
52
|
+
{
|
53
|
+
name: 'name',
|
54
|
+
type: 'varchar',
|
55
|
+
},
|
56
|
+
(0, utils_1.timestampColumn)(),
|
57
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
58
|
+
],
|
59
|
+
foreignKeys: [
|
60
|
+
new typeorm_1.TableForeignKey({
|
61
|
+
columnNames: ['menu_id'],
|
62
|
+
referencedColumnNames: ['id'],
|
63
|
+
referencedTableName: 'menus',
|
64
|
+
onDelete: 'CASCADE',
|
65
|
+
}),
|
66
|
+
new typeorm_1.TableForeignKey({
|
67
|
+
columnNames: ['locale_id'],
|
68
|
+
referencedColumnNames: ['id'],
|
69
|
+
referencedTableName: 'locales',
|
70
|
+
onDelete: 'CASCADE',
|
71
|
+
}),
|
72
|
+
],
|
73
|
+
}));
|
74
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
75
|
+
name: 'menu_screens',
|
76
|
+
columns: [
|
77
|
+
(0, utils_1.foreignColumn)({ name: 'menu_id', isPrimary: true }),
|
78
|
+
(0, utils_1.foreignColumn)({ name: 'screen_id', isPrimary: true }),
|
79
|
+
],
|
80
|
+
}));
|
81
|
+
await queryRunner.createForeignKey('menu_screens', new typeorm_1.TableForeignKey({
|
82
|
+
columnNames: ['menu_id'],
|
83
|
+
referencedColumnNames: ['id'],
|
84
|
+
referencedTableName: 'menus',
|
85
|
+
onDelete: 'CASCADE',
|
86
|
+
}));
|
87
|
+
await queryRunner.createForeignKey('menu_screens', new typeorm_1.TableForeignKey({
|
88
|
+
columnNames: ['screen_id'],
|
89
|
+
referencedColumnNames: ['id'],
|
90
|
+
referencedTableName: 'screens',
|
91
|
+
onDelete: 'CASCADE',
|
92
|
+
}));
|
93
|
+
}
|
94
|
+
async down(queryRunner) {
|
95
|
+
await queryRunner.dropTable('menu_screens');
|
96
|
+
await queryRunner.dropTable('menus');
|
97
|
+
}
|
98
|
+
}
|
99
|
+
exports.Migrate = Migrate;
|
100
|
+
//# sourceMappingURL=migrate-05.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-05.js","sourceRoot":"","sources":["../../src/__migrations/migrate-05.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,yCAAyE;AAEzE,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,OAAO;YACb,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;gBACpD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,QAAQ,E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migrate-06.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAsB,MAAM,SAAS,CAAC;AAE9E,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IA2B3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const utils_1 = require("@hedhog/utils");
|
5
|
+
const typeorm_1 = require("typeorm");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'routes',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'url',
|
14
|
+
type: 'varchar',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'method',
|
18
|
+
type: 'enum',
|
19
|
+
enum: ['GET', 'POST', 'PATCH', 'DELETE', 'PUT', 'OPTIONS', 'HEAD'],
|
20
|
+
},
|
21
|
+
(0, utils_1.timestampColumn)(),
|
22
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
23
|
+
],
|
24
|
+
indices: [
|
25
|
+
{
|
26
|
+
columnNames: ['url', 'method'],
|
27
|
+
isUnique: true,
|
28
|
+
},
|
29
|
+
],
|
30
|
+
}));
|
31
|
+
}
|
32
|
+
async down(queryRunner) {
|
33
|
+
await queryRunner.dropTable('routes');
|
34
|
+
}
|
35
|
+
}
|
36
|
+
exports.Migrate = Migrate;
|
37
|
+
//# sourceMappingURL=migrate-06.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-06.js","sourceRoot":"","sources":["../../src/__migrations/migrate-06.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAC1D,qCAA8E;AAE9E,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;iBACnE;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;YACD,OAAO,EAAE;gBACP;oBACE,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;oBAC9B,QAAQ,EAAE,IAAI;iBACf;aACF;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF;AA/BD,0BA+BC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-07.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-07.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAqD3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const utils_1 = require("@hedhog/utils");
|
5
|
+
const typeorm_1 = require("typeorm");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'roles',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'slug',
|
14
|
+
type: 'varchar',
|
15
|
+
isUnique: true,
|
16
|
+
},
|
17
|
+
(0, utils_1.timestampColumn)(),
|
18
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
19
|
+
],
|
20
|
+
}));
|
21
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
22
|
+
name: 'role_translations',
|
23
|
+
columns: [
|
24
|
+
(0, utils_1.foreignColumn)({ name: 'role_id', isPrimary: true }),
|
25
|
+
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
26
|
+
{
|
27
|
+
name: 'name',
|
28
|
+
type: 'varchar',
|
29
|
+
isNullable: false,
|
30
|
+
},
|
31
|
+
{
|
32
|
+
name: 'description',
|
33
|
+
type: 'varchar',
|
34
|
+
},
|
35
|
+
(0, utils_1.timestampColumn)(),
|
36
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
37
|
+
],
|
38
|
+
foreignKeys: [
|
39
|
+
new typeorm_1.TableForeignKey({
|
40
|
+
columnNames: ['role_id'],
|
41
|
+
referencedTableName: 'roles',
|
42
|
+
referencedColumnNames: ['id'],
|
43
|
+
onDelete: 'CASCADE',
|
44
|
+
}),
|
45
|
+
new typeorm_1.TableForeignKey({
|
46
|
+
columnNames: ['locale_id'],
|
47
|
+
referencedTableName: 'locales',
|
48
|
+
referencedColumnNames: ['id'],
|
49
|
+
onDelete: 'CASCADE',
|
50
|
+
}),
|
51
|
+
],
|
52
|
+
}));
|
53
|
+
}
|
54
|
+
async down(queryRunner) {
|
55
|
+
await queryRunner.dropTable('roles');
|
56
|
+
}
|
57
|
+
}
|
58
|
+
exports.Migrate = Migrate;
|
59
|
+
//# sourceMappingURL=migrate-07.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate-07.js","sourceRoot":"","sources":["../../src/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