@hedhog/admin 0.0.56 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/migrations/migrate-05.ts +9 -14
package/package.json
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import {
|
2
|
-
getRepository,
|
3
2
|
MigrationInterface,
|
4
3
|
QueryRunner,
|
5
4
|
Table,
|
@@ -124,18 +123,14 @@ export class Migrate implements MigrationInterface {
|
|
124
123
|
];
|
125
124
|
|
126
125
|
for (const menu of menus) {
|
127
|
-
const
|
126
|
+
const menuInserted = await queryRunner.manager.insert(Menu, {
|
127
|
+
url: menu.url,
|
128
|
+
order: menu.order,
|
129
|
+
icon: menu.icon,
|
130
|
+
slug: menu.slug,
|
131
|
+
});
|
128
132
|
|
129
|
-
|
130
|
-
await menuRepository.create({
|
131
|
-
url: menu.url,
|
132
|
-
order: menu.order,
|
133
|
-
icon: menu.icon,
|
134
|
-
slug: menu.slug,
|
135
|
-
}),
|
136
|
-
);
|
137
|
-
|
138
|
-
console.log('menu', m);
|
133
|
+
console.log('menuInserted', menuInserted);
|
139
134
|
|
140
135
|
await queryRunner.manager
|
141
136
|
.createQueryBuilder()
|
@@ -143,12 +138,12 @@ export class Migrate implements MigrationInterface {
|
|
143
138
|
.into('menu_translations', ['menu_id', 'locale_id', 'name'])
|
144
139
|
.values([
|
145
140
|
{
|
146
|
-
menu_id:
|
141
|
+
menu_id: menuInserted.identifiers[0].id,
|
147
142
|
locale_id: 1,
|
148
143
|
name: menu.name_en,
|
149
144
|
},
|
150
145
|
{
|
151
|
-
menu_id:
|
146
|
+
menu_id: menuInserted.identifiers[0].id,
|
152
147
|
locale_id: 2,
|
153
148
|
name: menu.name_pt,
|
154
149
|
},
|