@hedhog/admin 0.0.45 → 0.0.47

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -226,7 +226,7 @@ export class Migrate implements MigrationInterface {
226
226
  name: 'locales',
227
227
  columns: [
228
228
  idColumn(),
229
- foreignColumn('country_id'),
229
+ foreignColumn({ name: 'country_id' }),
230
230
  {
231
231
  name: 'code',
232
232
  type: 'char',
@@ -296,10 +296,9 @@ export class Migrate implements MigrationInterface {
296
296
  region: locales[index].region,
297
297
  country_id: locales[index].country_id,
298
298
  })
299
- .returning('id')
300
299
  .execute();
301
300
 
302
- locales[index].id = localeId.raw[0].id;
301
+ locales[index].id = localeId.raw.insertId;
303
302
  }
304
303
  }
305
304
 
@@ -37,8 +37,8 @@ export class Migrate implements MigrationInterface {
37
37
  name: 'translations',
38
38
  columns: [
39
39
  idColumn(),
40
- foreignColumn('locale_id'),
41
- foreignColumn('namespace_id'),
40
+ foreignColumn({ name: 'locale_id' }),
41
+ foreignColumn({ name: 'namespace_id' }),
42
42
  {
43
43
  name: 'name',
44
44
  type: 'varchar',
@@ -21,8 +21,8 @@ export class Migrate implements MigrationInterface {
21
21
  new Table({
22
22
  name: 'multifactor_translations',
23
23
  columns: [
24
- foreignColumn('multifactor_id', true),
25
- foreignColumn('locale_id', true),
24
+ foreignColumn({ name: 'multifactor_id', isPrimary: true }),
25
+ foreignColumn({ name: 'locale_id', isPrimary: true }),
26
26
  {
27
27
  name: 'name',
28
28
  type: 'varchar',
@@ -95,7 +95,7 @@ export class Migrate implements MigrationInterface {
95
95
  name: 'users',
96
96
  columns: [
97
97
  idColumn(),
98
- foreignColumn('multifactor_id'),
98
+ foreignColumn({ name: 'multifactor_id', isNullable: true }),
99
99
  {
100
100
  name: 'name',
101
101
  type: 'varchar',
@@ -34,8 +34,8 @@ export class Migrate implements MigrationInterface {
34
34
  new Table({
35
35
  name: 'screen_translations',
36
36
  columns: [
37
- foreignColumn('screen_id', true),
38
- foreignColumn('locale_id', true),
37
+ foreignColumn({ name: 'screen_id', isPrimary: true }),
38
+ foreignColumn({ name: 'locale_id', isPrimary: true }),
39
39
  {
40
40
  name: 'name',
41
41
  type: 'varchar',
@@ -13,7 +13,7 @@ export class Migrate implements MigrationInterface {
13
13
  name: 'menus',
14
14
  columns: [
15
15
  idColumn(),
16
- foreignColumn('menu_id'),
16
+ foreignColumn({ name: 'menu_id' }),
17
17
  {
18
18
  name: 'url',
19
19
  type: 'varchar',
@@ -80,8 +80,8 @@ export class Migrate implements MigrationInterface {
80
80
  new Table({
81
81
  name: 'menu_screens',
82
82
  columns: [
83
- foreignColumn('menu_id', true),
84
- foreignColumn('screen_id', true),
83
+ foreignColumn({ name: 'menu_id', isPrimary: true }),
84
+ foreignColumn({ name: 'screen_id', isPrimary: true }),
85
85
  ],
86
86
  }),
87
87
  );
@@ -133,7 +133,6 @@ export class Migrate implements MigrationInterface {
133
133
  order: menu.order,
134
134
  icon: menu.icon,
135
135
  })
136
- .returning('id')
137
136
  .execute();
138
137
 
139
138
  await queryRunner.manager
@@ -142,12 +141,12 @@ export class Migrate implements MigrationInterface {
142
141
  .into('menu_translations', ['menu_id', 'locale_id', 'name'])
143
142
  .values([
144
143
  {
145
- menu_id: m.raw[0].id,
144
+ menu_id: m.raw.insertId,
146
145
  locale_id: 1,
147
146
  name: menu.name_en,
148
147
  },
149
148
  {
150
- menu_id: m.raw[0].id,
149
+ menu_id: m.raw.insertId,
151
150
  locale_id: 2,
152
151
  name: menu.name_pt,
153
152
  },
@@ -218,7 +217,6 @@ export class Migrate implements MigrationInterface {
218
217
  icon: menu.icon,
219
218
  menu_id: menuManagement[0].id,
220
219
  })
221
- .returning('id')
222
220
  .execute();
223
221
 
224
222
  await queryRunner.manager
@@ -227,12 +225,12 @@ export class Migrate implements MigrationInterface {
227
225
  .into('menu_translations', ['menu_id', 'locale_id', 'name'])
228
226
  .values([
229
227
  {
230
- menu_id: m.raw[0].id,
228
+ menu_id: m.raw.insertId,
231
229
  locale_id: 1,
232
230
  name: menu.name_en,
233
231
  },
234
232
  {
235
- menu_id: m.raw[0].id,
233
+ menu_id: m.raw.insertId,
236
234
  locale_id: 2,
237
235
  name: menu.name_pt,
238
236
  },
@@ -19,8 +19,8 @@ export class Migrate implements MigrationInterface {
19
19
  new Table({
20
20
  name: 'role_translations',
21
21
  columns: [
22
- foreignColumn('role_id', true),
23
- foreignColumn('locale_id', true),
22
+ foreignColumn({ name: 'role_id', isPrimary: true }),
23
+ foreignColumn({ name: 'locale_id', isPrimary: true }),
24
24
  {
25
25
  name: 'name',
26
26
  type: 'varchar',
@@ -12,8 +12,8 @@ export class Migrate implements MigrationInterface {
12
12
  new Table({
13
13
  name: 'role_menus',
14
14
  columns: [
15
- foreignColumn('role_id', true),
16
- foreignColumn('menu_id', true),
15
+ foreignColumn({ name: 'role_id', isPrimary: true }),
16
+ foreignColumn({ name: 'menu_id', isPrimary: true }),
17
17
  timestampColumn(),
18
18
  timestampColumn('updated_at'),
19
19
  ],
@@ -12,8 +12,8 @@ export class Migrate implements MigrationInterface {
12
12
  new Table({
13
13
  name: 'route_screens',
14
14
  columns: [
15
- foreignColumn('route_id', true),
16
- foreignColumn('screen_id', true),
15
+ foreignColumn({ name: 'route_id', isPrimary: true }),
16
+ foreignColumn({ name: 'screen_id', isPrimary: true }),
17
17
  timestampColumn(),
18
18
  timestampColumn('updated_at'),
19
19
  ],
@@ -12,8 +12,8 @@ export class Migrate implements MigrationInterface {
12
12
  new Table({
13
13
  name: 'role_screens',
14
14
  columns: [
15
- foreignColumn('role_id', true),
16
- foreignColumn('screen_id', true),
15
+ foreignColumn({ name: 'role_id', isPrimary: true }),
16
+ foreignColumn({ name: 'screen_id', isPrimary: true }),
17
17
  timestampColumn(),
18
18
  timestampColumn('updated_at'),
19
19
  ],
@@ -12,8 +12,8 @@ export class Migrate implements MigrationInterface {
12
12
  new Table({
13
13
  name: 'role_users',
14
14
  columns: [
15
- foreignColumn('role_id', true),
16
- foreignColumn('user_id', true),
15
+ foreignColumn({ name: 'role_id', isPrimary: true }),
16
+ foreignColumn({ name: 'user_id', isPrimary: true }),
17
17
  timestampColumn(),
18
18
  timestampColumn('updated_at'),
19
19
  ],
@@ -12,8 +12,8 @@ export class Migrate implements MigrationInterface {
12
12
  new Table({
13
13
  name: 'role_routes',
14
14
  columns: [
15
- foreignColumn('role_id', true),
16
- foreignColumn('route_id', true),
15
+ foreignColumn({ name: 'role_id', isPrimary: true }),
16
+ foreignColumn({ name: 'route_id', isPrimary: true }),
17
17
  timestampColumn(),
18
18
  timestampColumn('updated_at'),
19
19
  ],
@@ -28,8 +28,8 @@ export class Migrate implements MigrationInterface {
28
28
  new Table({
29
29
  name: 'setting_group_translations',
30
30
  columns: [
31
- foreignColumn('locale_id', true),
32
- foreignColumn('group_id', true),
31
+ foreignColumn({ name: 'locale_id', isPrimary: true }),
32
+ foreignColumn({ name: 'group_id', isPrimary: true }),
33
33
  {
34
34
  name: 'name',
35
35
  type: 'varchar',
@@ -66,7 +66,7 @@ export class Migrate implements MigrationInterface {
66
66
  name: 'settings',
67
67
  columns: [
68
68
  idColumn(),
69
- foreignColumn('group_id'),
69
+ foreignColumn({ name: 'group_id' }),
70
70
  {
71
71
  name: 'slug',
72
72
  type: 'varchar',
@@ -108,8 +108,8 @@ export class Migrate implements MigrationInterface {
108
108
  new Table({
109
109
  name: 'setting_translations',
110
110
  columns: [
111
- foreignColumn('locale_id', true),
112
- foreignColumn('setting_id', true),
111
+ foreignColumn({ name: 'locale_id', isPrimary: true }),
112
+ foreignColumn({ name: 'setting_id', isPrimary: true }),
113
113
  {
114
114
  name: 'description',
115
115
  type: 'varchar',
@@ -146,8 +146,8 @@ export class Migrate implements MigrationInterface {
146
146
  new Table({
147
147
  name: 'setting_users',
148
148
  columns: [
149
- foreignColumn('user_id', true),
150
- foreignColumn('setting_id', true),
149
+ foreignColumn({ name: 'user_id', isPrimary: true }),
150
+ foreignColumn({ name: 'setting_id', isPrimary: true }),
151
151
  {
152
152
  name: 'value',
153
153
  type: 'varchar',
@@ -182,10 +182,9 @@ export class Migrate implements MigrationInterface {
182
182
  icon: group.icon,
183
183
  slug: group.slug,
184
184
  })
185
- .returning('id')
186
185
  .execute();
187
186
 
188
- const settingGroupId = settingGroup.raw[0].id;
187
+ const settingGroupId = settingGroup.raw.insertId;
189
188
 
190
189
  await queryRunner.manager
191
190
  .createQueryBuilder()
@@ -223,10 +222,9 @@ export class Migrate implements MigrationInterface {
223
222
  type: s.type,
224
223
  value: s.value,
225
224
  })
226
- .returning('id')
227
225
  .execute();
228
226
 
229
- const settingId = setting.raw[0].id;
227
+ const settingId = setting.raw.insertId;
230
228
 
231
229
  await queryRunner.manager
232
230
  .createQueryBuilder()