@hedhog/admin 0.0.88 → 0.0.90
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/entities/locale.entity.d.ts +0 -1
- package/dist/entities/locale.entity.d.ts.map +1 -1
- package/dist/entities/locale.entity.js +0 -7
- package/dist/entities/locale.entity.js.map +1 -1
- package/dist/locale/dto/create.dto.d.ts +0 -1
- package/dist/locale/dto/create.dto.d.ts.map +1 -1
- package/dist/locale/dto/create.dto.js +0 -4
- package/dist/locale/dto/create.dto.js.map +1 -1
- package/dist/locale/dto/update.dto.d.ts +0 -1
- package/dist/locale/dto/update.dto.d.ts.map +1 -1
- package/dist/locale/dto/update.dto.js +0 -5
- package/dist/locale/dto/update.dto.js.map +1 -1
- package/dist/locale/locale.controller.d.ts +1 -1
- package/dist/locale/locale.controller.d.ts.map +1 -1
- package/dist/locale/locale.controller.js +14 -11
- package/dist/locale/locale.controller.js.map +1 -1
- package/dist/locale/locale.service.d.ts +1 -1
- package/dist/locale/locale.service.d.ts.map +1 -1
- package/dist/locale/locale.service.js +2 -2
- package/dist/locale/locale.service.js.map +1 -1
- package/dist/locale/locale.service.spec.js +0 -5
- package/dist/locale/locale.service.spec.js.map +1 -1
- package/dist/role/guards/role.guard.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +8 -0
- package/dist/role/guards/role.guard.js.map +1 -1
- package/hedhog.yaml +1 -4
- package/package.json +1 -1
- package/src/entities/locale.entity.ts +0 -6
- package/dist/__migrations/migrate-01.d.ts +0 -6
- package/dist/__migrations/migrate-01.d.ts.map +0 -1
- package/dist/__migrations/migrate-01.js +0 -80
- package/dist/__migrations/migrate-01.js.map +0 -1
- package/dist/__migrations/migrate-02.d.ts +0 -6
- package/dist/__migrations/migrate-02.d.ts.map +0 -1
- package/dist/__migrations/migrate-02.js +0 -68
- package/dist/__migrations/migrate-02.js.map +0 -1
- package/dist/__migrations/migrate-03.d.ts +0 -6
- package/dist/__migrations/migrate-03.d.ts.map +0 -1
- package/dist/__migrations/migrate-03.js +0 -90
- package/dist/__migrations/migrate-03.js.map +0 -1
- package/dist/__migrations/migrate-04.d.ts +0 -6
- package/dist/__migrations/migrate-04.d.ts.map +0 -1
- package/dist/__migrations/migrate-04.js +0 -63
- package/dist/__migrations/migrate-04.js.map +0 -1
- package/dist/__migrations/migrate-05.d.ts +0 -6
- package/dist/__migrations/migrate-05.d.ts.map +0 -1
- package/dist/__migrations/migrate-05.js +0 -100
- package/dist/__migrations/migrate-05.js.map +0 -1
- package/dist/__migrations/migrate-06.d.ts +0 -6
- package/dist/__migrations/migrate-06.d.ts.map +0 -1
- package/dist/__migrations/migrate-06.js +0 -37
- package/dist/__migrations/migrate-06.js.map +0 -1
- package/dist/__migrations/migrate-07.d.ts +0 -6
- package/dist/__migrations/migrate-07.d.ts.map +0 -1
- package/dist/__migrations/migrate-07.js +0 -59
- package/dist/__migrations/migrate-07.js.map +0 -1
- package/dist/__migrations/migrate-08.d.ts +0 -6
- package/dist/__migrations/migrate-08.d.ts.map +0 -1
- package/dist/__migrations/migrate-08.js +0 -39
- package/dist/__migrations/migrate-08.js.map +0 -1
- package/dist/__migrations/migrate-09.d.ts +0 -6
- package/dist/__migrations/migrate-09.d.ts.map +0 -1
- package/dist/__migrations/migrate-09.js +0 -39
- package/dist/__migrations/migrate-09.js.map +0 -1
- package/dist/__migrations/migrate-10.d.ts +0 -6
- package/dist/__migrations/migrate-10.d.ts.map +0 -1
- package/dist/__migrations/migrate-10.js +0 -39
- package/dist/__migrations/migrate-10.js.map +0 -1
- package/dist/__migrations/migrate-11.d.ts +0 -6
- package/dist/__migrations/migrate-11.d.ts.map +0 -1
- package/dist/__migrations/migrate-11.js +0 -39
- package/dist/__migrations/migrate-11.js.map +0 -1
- package/dist/__migrations/migrate-12.d.ts +0 -6
- package/dist/__migrations/migrate-12.d.ts.map +0 -1
- package/dist/__migrations/migrate-12.js +0 -39
- package/dist/__migrations/migrate-12.js.map +0 -1
- package/dist/__migrations/migrate-13.d.ts +0 -6
- package/dist/__migrations/migrate-13.d.ts.map +0 -1
- package/dist/__migrations/migrate-13.js +0 -30
- package/dist/__migrations/migrate-13.js.map +0 -1
- package/dist/__migrations/migrate-14.d.ts +0 -6
- package/dist/__migrations/migrate-14.d.ts.map +0 -1
- package/dist/__migrations/migrate-14.js +0 -83
- package/dist/__migrations/migrate-14.js.map +0 -1
- package/dist/__migrations/migrate-15.d.ts +0 -6
- package/dist/__migrations/migrate-15.d.ts.map +0 -1
- package/dist/__migrations/migrate-15.js +0 -25
- package/dist/__migrations/migrate-15.js.map +0 -1
- package/dist/__migrations/migrate-16.d.ts +0 -6
- package/dist/__migrations/migrate-16.d.ts.map +0 -1
- package/dist/__migrations/migrate-16.js +0 -61
- package/dist/__migrations/migrate-16.js.map +0 -1
- package/dist/__migrations/migrate-17.d.ts +0 -6
- package/dist/__migrations/migrate-17.d.ts.map +0 -1
- package/dist/__migrations/migrate-17.js +0 -31
- package/dist/__migrations/migrate-17.js.map +0 -1
- package/dist/__migrations/migrate-18.d.ts +0 -6
- package/dist/__migrations/migrate-18.d.ts.map +0 -1
- package/dist/__migrations/migrate-18.js +0 -41
- package/dist/__migrations/migrate-18.js.map +0 -1
- package/dist/__migrations/migrate-19.d.ts +0 -6
- package/dist/__migrations/migrate-19.d.ts.map +0 -1
- package/dist/__migrations/migrate-19.js +0 -175
- package/dist/__migrations/migrate-19.js.map +0 -1
- package/dist/__migrations/migrate-20.d.ts +0 -6
- package/dist/__migrations/migrate-20.d.ts.map +0 -1
- package/dist/__migrations/migrate-20.js +0 -310
- package/dist/__migrations/migrate-20.js.map +0 -1
@@ -1,39 +0,0 @@
|
|
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: 'role_users',
|
10
|
-
columns: [
|
11
|
-
(0, utils_1.foreignColumn)({ name: 'role_id', isPrimary: true }),
|
12
|
-
(0, utils_1.foreignColumn)({ name: 'user_id', isPrimary: true }),
|
13
|
-
(0, utils_1.timestampColumn)(),
|
14
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
15
|
-
],
|
16
|
-
}));
|
17
|
-
await queryRunner.createForeignKeys('role_users', [
|
18
|
-
new typeorm_1.TableForeignKey({
|
19
|
-
columnNames: ['role_id'],
|
20
|
-
referencedColumnNames: ['id'],
|
21
|
-
referencedTableName: 'roles',
|
22
|
-
onDelete: 'CASCADE',
|
23
|
-
name: 'fk_role_users_roles',
|
24
|
-
}),
|
25
|
-
new typeorm_1.TableForeignKey({
|
26
|
-
columnNames: ['user_id'],
|
27
|
-
referencedColumnNames: ['id'],
|
28
|
-
referencedTableName: 'users',
|
29
|
-
onDelete: 'CASCADE',
|
30
|
-
name: 'fk_role_users_users',
|
31
|
-
}),
|
32
|
-
]);
|
33
|
-
}
|
34
|
-
async down(queryRunner) {
|
35
|
-
await queryRunner.dropTable('role_users');
|
36
|
-
}
|
37
|
-
}
|
38
|
-
exports.Migrate = Migrate;
|
39
|
-
//# sourceMappingURL=migrate-11.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-11.js","sourceRoot":"","sources":["../../src/__migrations/migrate-11.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAC/D,qCAKiB;AAEjB,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE;gBACP,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACnD,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACnD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,MAAM,WAAW,CAAC,iBAAiB,CAAC,YAAY,EAAE;YAChD,IAAI,yBAAe,CAAC;gBAClB,WAAW,EAAE,CAAC,SAAS,CAAC;gBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,OAAO;gBAC5B,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,qBAAqB;aAC5B,CAAC;YAEF,IAAI,yBAAe,CAAC;gBAClB,WAAW,EAAE,CAAC,SAAS,CAAC;gBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,OAAO;gBAC5B,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,qBAAqB;aAC5B,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC;CACF;AApCD,0BAoCC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-12.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-12.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IA+B3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -1,39 +0,0 @@
|
|
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: 'role_routes',
|
10
|
-
columns: [
|
11
|
-
(0, utils_1.foreignColumn)({ name: 'role_id', isPrimary: true }),
|
12
|
-
(0, utils_1.foreignColumn)({ name: 'route_id', isPrimary: true }),
|
13
|
-
(0, utils_1.timestampColumn)(),
|
14
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
15
|
-
],
|
16
|
-
}));
|
17
|
-
await queryRunner.createForeignKeys('role_routes', [
|
18
|
-
new typeorm_1.TableForeignKey({
|
19
|
-
columnNames: ['role_id'],
|
20
|
-
referencedColumnNames: ['id'],
|
21
|
-
referencedTableName: 'roles',
|
22
|
-
onDelete: 'CASCADE',
|
23
|
-
name: 'fk_role_routes_roles',
|
24
|
-
}),
|
25
|
-
new typeorm_1.TableForeignKey({
|
26
|
-
columnNames: ['route_id'],
|
27
|
-
referencedColumnNames: ['id'],
|
28
|
-
referencedTableName: 'routes',
|
29
|
-
onDelete: 'CASCADE',
|
30
|
-
name: 'fk_role_routes_routes',
|
31
|
-
}),
|
32
|
-
]);
|
33
|
-
}
|
34
|
-
async down(queryRunner) {
|
35
|
-
await queryRunner.dropTable('role_routes');
|
36
|
-
}
|
37
|
-
}
|
38
|
-
exports.Migrate = Migrate;
|
39
|
-
//# sourceMappingURL=migrate-12.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-12.js","sourceRoot":"","sources":["../../src/__migrations/migrate-12.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAC/D,qCAKiB;AAEjB,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE;gBACP,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACnD,IAAA,qBAAa,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,MAAM,WAAW,CAAC,iBAAiB,CAAC,aAAa,EAAE;YACjD,IAAI,yBAAe,CAAC;gBAClB,WAAW,EAAE,CAAC,SAAS,CAAC;gBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,OAAO;gBAC5B,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,sBAAsB;aAC7B,CAAC;YACF,IAAI,yBAAe,CAAC;gBAClB,WAAW,EAAE,CAAC,UAAU,CAAC;gBACzB,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,QAAQ;gBAC7B,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,uBAAuB;aAC9B,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC;CACF;AAnCD,0BAmCC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-13.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-13.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAqB3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
const menus = await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.select()
|
10
|
-
.from('menus', 'm')
|
11
|
-
.execute();
|
12
|
-
|
13
|
-
for (const menu of menus) {
|
14
|
-
await queryRunner.manager
|
15
|
-
.createQueryBuilder()
|
16
|
-
.insert()
|
17
|
-
.into('role_menus')
|
18
|
-
.values({
|
19
|
-
role_id: 1,
|
20
|
-
menu_id: menu.id,
|
21
|
-
});
|
22
|
-
}
|
23
|
-
*/
|
24
|
-
}
|
25
|
-
async down(queryRunner) {
|
26
|
-
await queryRunner.manager.delete('role_menus', { role_id: 1 });
|
27
|
-
}
|
28
|
-
}
|
29
|
-
exports.Migrate = Migrate;
|
30
|
-
//# sourceMappingURL=migrate-13.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-13.js","sourceRoot":"","sources":["../../src/__migrations/migrate-13.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;;;;;;;cAiBM;IACR,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAzBD,0BAyBC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-14.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-14.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IA0E3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -1,83 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
const screenIdScreen = await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.select()
|
10
|
-
.from('screens', 's')
|
11
|
-
.where('slug = :slug', { slug: '/management/screens' })
|
12
|
-
.execute();
|
13
|
-
|
14
|
-
const screenIdRole = await queryRunner.manager
|
15
|
-
.createQueryBuilder()
|
16
|
-
.select()
|
17
|
-
.from('screens', 's')
|
18
|
-
.where('slug = :slug', { slug: '/management/roles' })
|
19
|
-
.execute();
|
20
|
-
|
21
|
-
const screenIdUser = await queryRunner.manager
|
22
|
-
.createQueryBuilder()
|
23
|
-
.select()
|
24
|
-
.from('screens', 's')
|
25
|
-
.where('slug = :slug', { slug: '/management/users' })
|
26
|
-
.execute();
|
27
|
-
|
28
|
-
const screenIdMenu = await queryRunner.manager
|
29
|
-
.createQueryBuilder()
|
30
|
-
.select()
|
31
|
-
.from('screens', 's')
|
32
|
-
.where('slug = :slug', { slug: '/management/menus' })
|
33
|
-
.execute();
|
34
|
-
|
35
|
-
const screenIdRoute = await queryRunner.manager
|
36
|
-
.createQueryBuilder()
|
37
|
-
.select()
|
38
|
-
.from('screens', 's')
|
39
|
-
.where('slug = :slug', { slug: '/management/routes' })
|
40
|
-
.execute();
|
41
|
-
|
42
|
-
const screenIdSetting = await queryRunner.manager
|
43
|
-
.createQueryBuilder()
|
44
|
-
.select()
|
45
|
-
.from('screens', 's')
|
46
|
-
.where('slug = :slug', { slug: '/management/settings' })
|
47
|
-
.execute();
|
48
|
-
|
49
|
-
for (const { url, screendId } of [
|
50
|
-
{ url: '/screens%', screendId: screenIdScreen[0].id },
|
51
|
-
{ url: '/roles%', screendId: screenIdRole[0].id },
|
52
|
-
{ url: '/users%', screendId: screenIdUser[0].id },
|
53
|
-
{ url: '/menus%', screendId: screenIdMenu[0].id },
|
54
|
-
{ url: '/routes%', screendId: screenIdRoute[0].id },
|
55
|
-
{ url: '/settings%', screendId: screenIdSetting[0].id },
|
56
|
-
]) {
|
57
|
-
const routesScreens = await queryRunner.manager
|
58
|
-
.createQueryBuilder()
|
59
|
-
.select()
|
60
|
-
.from('routes', 's')
|
61
|
-
.where('s.url LIKE :url', { url })
|
62
|
-
.execute();
|
63
|
-
|
64
|
-
for (const route of routesScreens) {
|
65
|
-
await queryRunner.manager
|
66
|
-
.createQueryBuilder()
|
67
|
-
.insert()
|
68
|
-
.into('route_screens')
|
69
|
-
.values({
|
70
|
-
route_id: route.id,
|
71
|
-
screen_id: screendId,
|
72
|
-
})
|
73
|
-
.execute();
|
74
|
-
}
|
75
|
-
}
|
76
|
-
*/
|
77
|
-
}
|
78
|
-
async down(queryRunner) {
|
79
|
-
await queryRunner.manager.delete('route_screens', {});
|
80
|
-
}
|
81
|
-
}
|
82
|
-
exports.Migrate = Migrate;
|
83
|
-
//# sourceMappingURL=migrate-14.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-14.js","sourceRoot":"","sources":["../../src/__migrations/migrate-14.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAsEI;IACN,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AA9ED,0BA8EC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-15.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-15.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAe3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAIpC"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.insert()
|
10
|
-
.into('role_users', ['role_id', 'user_id'])
|
11
|
-
.values([
|
12
|
-
{ role_id: 1, user_id: 1 },
|
13
|
-
{ role_id: 2, user_id: 2 },
|
14
|
-
{ role_id: 3, user_id: 2 },
|
15
|
-
])
|
16
|
-
.execute();
|
17
|
-
*/
|
18
|
-
}
|
19
|
-
async down(queryRunner) {
|
20
|
-
await queryRunner.manager.delete('role_users', { role_id: 1 });
|
21
|
-
await queryRunner.manager.delete('role_users', { role_id: 2 });
|
22
|
-
}
|
23
|
-
}
|
24
|
-
exports.Migrate = Migrate;
|
25
|
-
//# sourceMappingURL=migrate-15.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-15.js","sourceRoot":"","sources":["../../src/__migrations/migrate-15.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;YAWI;IACN,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/D,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AApBD,0BAoBC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-16.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-16.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAmD3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAIpC"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
const routes = await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.select()
|
10
|
-
.from('routes', 'r')
|
11
|
-
.execute();
|
12
|
-
|
13
|
-
for (const route of routes) {
|
14
|
-
await queryRunner.manager
|
15
|
-
.createQueryBuilder()
|
16
|
-
.insert()
|
17
|
-
.into('role_routes', ['role_id', 'route_id'])
|
18
|
-
.values({
|
19
|
-
role_id: 1,
|
20
|
-
route_id: route.id,
|
21
|
-
})
|
22
|
-
.execute();
|
23
|
-
}
|
24
|
-
|
25
|
-
await queryRunner.manager
|
26
|
-
.createQueryBuilder()
|
27
|
-
.insert()
|
28
|
-
.into('role_routes', ['role_id', 'route_id'])
|
29
|
-
.values({
|
30
|
-
role_id: 2,
|
31
|
-
route_id: 3,
|
32
|
-
})
|
33
|
-
.execute();
|
34
|
-
|
35
|
-
const routesScreens = await queryRunner.manager
|
36
|
-
.createQueryBuilder()
|
37
|
-
.select()
|
38
|
-
.from('routes', 's')
|
39
|
-
.where('s.url LIKE :url', { url: '/screens%' })
|
40
|
-
.execute();
|
41
|
-
|
42
|
-
for (const route of routesScreens) {
|
43
|
-
await queryRunner.manager
|
44
|
-
.createQueryBuilder()
|
45
|
-
.insert()
|
46
|
-
.into('role_routes', ['role_id', 'route_id'])
|
47
|
-
.values({
|
48
|
-
role_id: 2,
|
49
|
-
route_id: route.id,
|
50
|
-
})
|
51
|
-
.execute();
|
52
|
-
}
|
53
|
-
*/
|
54
|
-
}
|
55
|
-
async down(queryRunner) {
|
56
|
-
await queryRunner.manager.delete('role_routes', { role_id: 1 });
|
57
|
-
await queryRunner.manager.delete('role_routes', { role_id: 2 });
|
58
|
-
}
|
59
|
-
}
|
60
|
-
exports.Migrate = Migrate;
|
61
|
-
//# sourceMappingURL=migrate-16.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-16.js","sourceRoot":"","sources":["../../src/__migrations/migrate-16.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+CM;IACR,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAChE,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAxDD,0BAwDC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-17.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-17.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IAsB3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
const screens = await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.select()
|
10
|
-
.from('screens', 's')
|
11
|
-
.execute();
|
12
|
-
|
13
|
-
for (const screen of screens) {
|
14
|
-
await queryRunner.manager
|
15
|
-
.createQueryBuilder()
|
16
|
-
.insert()
|
17
|
-
.into('role_screens', ['role_id', 'screen_id'])
|
18
|
-
.values({
|
19
|
-
role_id: 1,
|
20
|
-
screen_id: screen.id,
|
21
|
-
})
|
22
|
-
.execute();
|
23
|
-
}
|
24
|
-
*/
|
25
|
-
}
|
26
|
-
async down(queryRunner) {
|
27
|
-
await queryRunner.manager.delete('role_screens', { role_id: 1 });
|
28
|
-
}
|
29
|
-
}
|
30
|
-
exports.Migrate = Migrate;
|
31
|
-
//# sourceMappingURL=migrate-17.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-17.js","sourceRoot":"","sources":["../../src/__migrations/migrate-17.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;;;;;;;;cAkBM;IACR,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA1BD,0BA0BC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-18.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-18.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IAC1C,EAAE,CAAC,WAAW,EAAE,WAAW;IA+B3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAIpC"}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migrate = void 0;
|
4
|
-
class Migrate {
|
5
|
-
async up(queryRunner) {
|
6
|
-
/*
|
7
|
-
const menus = await queryRunner.manager
|
8
|
-
.createQueryBuilder()
|
9
|
-
.select()
|
10
|
-
.from('menus', 'm')
|
11
|
-
.execute();
|
12
|
-
|
13
|
-
await queryRunner.manager
|
14
|
-
.createQueryBuilder()
|
15
|
-
.insert()
|
16
|
-
.into('role_menus', ['role_id', 'menu_id'])
|
17
|
-
.values(
|
18
|
-
menus.map((menu) => ({
|
19
|
-
role_id: 1,
|
20
|
-
menu_id: menu.id,
|
21
|
-
})),
|
22
|
-
)
|
23
|
-
.execute();
|
24
|
-
|
25
|
-
await queryRunner.manager
|
26
|
-
.createQueryBuilder()
|
27
|
-
.insert()
|
28
|
-
.into('role_menus', ['role_id', 'menu_id'])
|
29
|
-
.values({
|
30
|
-
role_id: 2,
|
31
|
-
menu_id: 1,
|
32
|
-
});
|
33
|
-
*/
|
34
|
-
}
|
35
|
-
async down(queryRunner) {
|
36
|
-
await queryRunner.manager.delete('role_menus', { role_id: 1 });
|
37
|
-
await queryRunner.manager.delete('role_menus', { role_id: 2 });
|
38
|
-
}
|
39
|
-
}
|
40
|
-
exports.Migrate = Migrate;
|
41
|
-
//# sourceMappingURL=migrate-18.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-18.js","sourceRoot":"","sources":["../../src/__migrations/migrate-18.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BI;IACN,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/D,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AApCD,0BAoCC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"migrate-19.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-19.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;IA8K3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAO3D"}
|
@@ -1,175 +0,0 @@
|
|
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: 'setting_groups',
|
10
|
-
columns: [
|
11
|
-
(0, utils_1.idColumn)(),
|
12
|
-
{
|
13
|
-
name: 'icon',
|
14
|
-
type: 'varchar',
|
15
|
-
length: '31',
|
16
|
-
},
|
17
|
-
{
|
18
|
-
name: 'slug',
|
19
|
-
type: 'varchar',
|
20
|
-
length: '63',
|
21
|
-
isUnique: true,
|
22
|
-
},
|
23
|
-
(0, utils_1.timestampColumn)(),
|
24
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
25
|
-
],
|
26
|
-
}));
|
27
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
28
|
-
name: 'setting_group_translations',
|
29
|
-
columns: [
|
30
|
-
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
31
|
-
(0, utils_1.foreignColumn)({ name: 'group_id', isPrimary: true }),
|
32
|
-
{
|
33
|
-
name: 'name',
|
34
|
-
type: 'varchar',
|
35
|
-
length: '63',
|
36
|
-
},
|
37
|
-
{
|
38
|
-
name: 'description',
|
39
|
-
type: 'varchar',
|
40
|
-
length: '255',
|
41
|
-
isNullable: true,
|
42
|
-
},
|
43
|
-
(0, utils_1.timestampColumn)(),
|
44
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
45
|
-
],
|
46
|
-
foreignKeys: [
|
47
|
-
{
|
48
|
-
columnNames: ['locale_id'],
|
49
|
-
referencedColumnNames: ['id'],
|
50
|
-
referencedTableName: 'locales',
|
51
|
-
onDelete: 'CASCADE',
|
52
|
-
},
|
53
|
-
{
|
54
|
-
columnNames: ['group_id'],
|
55
|
-
referencedColumnNames: ['id'],
|
56
|
-
referencedTableName: 'setting_groups',
|
57
|
-
onDelete: 'CASCADE',
|
58
|
-
},
|
59
|
-
],
|
60
|
-
}));
|
61
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
62
|
-
name: 'settings',
|
63
|
-
columns: [
|
64
|
-
(0, utils_1.idColumn)(),
|
65
|
-
(0, utils_1.foreignColumn)({ name: 'group_id' }),
|
66
|
-
{
|
67
|
-
name: 'slug',
|
68
|
-
type: 'varchar',
|
69
|
-
isUnique: true,
|
70
|
-
length: '63',
|
71
|
-
},
|
72
|
-
{
|
73
|
-
name: 'type',
|
74
|
-
type: 'enum',
|
75
|
-
enum: ['string', 'number', 'boolean', 'json'],
|
76
|
-
default: "'string'",
|
77
|
-
},
|
78
|
-
{
|
79
|
-
name: 'value',
|
80
|
-
type: 'varchar',
|
81
|
-
length: '1023',
|
82
|
-
isNullable: true,
|
83
|
-
},
|
84
|
-
{
|
85
|
-
name: 'userOverride',
|
86
|
-
type: 'boolean',
|
87
|
-
default: false,
|
88
|
-
},
|
89
|
-
(0, utils_1.timestampColumn)(),
|
90
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
91
|
-
],
|
92
|
-
foreignKeys: [
|
93
|
-
{
|
94
|
-
columnNames: ['group_id'],
|
95
|
-
referencedColumnNames: ['id'],
|
96
|
-
referencedTableName: 'setting_groups',
|
97
|
-
onDelete: 'CASCADE',
|
98
|
-
},
|
99
|
-
],
|
100
|
-
}));
|
101
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
102
|
-
name: 'setting_translations',
|
103
|
-
columns: [
|
104
|
-
(0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
|
105
|
-
(0, utils_1.foreignColumn)({ name: 'setting_id', isPrimary: true }),
|
106
|
-
{
|
107
|
-
name: 'description',
|
108
|
-
type: 'varchar',
|
109
|
-
isNullable: true,
|
110
|
-
length: '255',
|
111
|
-
},
|
112
|
-
{
|
113
|
-
name: 'name',
|
114
|
-
type: 'varchar',
|
115
|
-
isNullable: true,
|
116
|
-
length: '63',
|
117
|
-
},
|
118
|
-
(0, utils_1.timestampColumn)(),
|
119
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
120
|
-
],
|
121
|
-
foreignKeys: [
|
122
|
-
{
|
123
|
-
columnNames: ['locale_id'],
|
124
|
-
referencedColumnNames: ['id'],
|
125
|
-
referencedTableName: 'locales',
|
126
|
-
onDelete: 'CASCADE',
|
127
|
-
},
|
128
|
-
{
|
129
|
-
columnNames: ['setting_id'],
|
130
|
-
referencedColumnNames: ['id'],
|
131
|
-
referencedTableName: 'settings',
|
132
|
-
onDelete: 'CASCADE',
|
133
|
-
},
|
134
|
-
],
|
135
|
-
}));
|
136
|
-
await queryRunner.createTable(new typeorm_1.Table({
|
137
|
-
name: 'setting_users',
|
138
|
-
columns: [
|
139
|
-
(0, utils_1.foreignColumn)({ name: 'user_id', isPrimary: true }),
|
140
|
-
(0, utils_1.foreignColumn)({ name: 'setting_id', isPrimary: true }),
|
141
|
-
{
|
142
|
-
name: 'value',
|
143
|
-
type: 'varchar',
|
144
|
-
length: '1023',
|
145
|
-
isNullable: true,
|
146
|
-
},
|
147
|
-
(0, utils_1.timestampColumn)(),
|
148
|
-
(0, utils_1.timestampColumn)('updated_at'),
|
149
|
-
],
|
150
|
-
foreignKeys: [
|
151
|
-
{
|
152
|
-
columnNames: ['user_id'],
|
153
|
-
referencedColumnNames: ['id'],
|
154
|
-
referencedTableName: 'users',
|
155
|
-
onDelete: 'CASCADE',
|
156
|
-
},
|
157
|
-
{
|
158
|
-
columnNames: ['setting_id'],
|
159
|
-
referencedColumnNames: ['id'],
|
160
|
-
referencedTableName: 'settings',
|
161
|
-
onDelete: 'CASCADE',
|
162
|
-
},
|
163
|
-
],
|
164
|
-
}));
|
165
|
-
}
|
166
|
-
async down(queryRunner) {
|
167
|
-
await queryRunner.dropTable('setting_users');
|
168
|
-
await queryRunner.dropTable('setting_translations');
|
169
|
-
await queryRunner.dropTable('settings');
|
170
|
-
await queryRunner.dropTable('setting_group_translations');
|
171
|
-
await queryRunner.dropTable('setting_groups');
|
172
|
-
}
|
173
|
-
}
|
174
|
-
exports.Migrate = Migrate;
|
175
|
-
//# sourceMappingURL=migrate-19.js.map
|