@hedhog/admin 0.0.60 → 0.0.62
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/hedhog.yaml +36 -0
- package/package.json +1 -1
- package/src/migrations/migrate-01.ts +0 -43
- package/src/migrations/migrate-02.ts +0 -51
package/hedhog.yaml
CHANGED
@@ -1022,3 +1022,39 @@ data:
|
|
1022
1022
|
- users:
|
1023
1023
|
- email: root@hedhog.com
|
1024
1024
|
- email: user@hedhog.com
|
1025
|
+
locales:
|
1026
|
+
- code: en
|
1027
|
+
region: US
|
1028
|
+
country_id:
|
1029
|
+
code: USA
|
1030
|
+
- code: pt
|
1031
|
+
region: BR
|
1032
|
+
country_id:
|
1033
|
+
code: BRA
|
1034
|
+
translations:
|
1035
|
+
- name: translation
|
1036
|
+
translations:
|
1037
|
+
- locale_id:
|
1038
|
+
code: en
|
1039
|
+
name: slogan
|
1040
|
+
value: Administration Panel
|
1041
|
+
- locale_id:
|
1042
|
+
code: pt
|
1043
|
+
name: slogan
|
1044
|
+
value: Painel de Administração
|
1045
|
+
- locale_id:
|
1046
|
+
code: en
|
1047
|
+
name: en
|
1048
|
+
value: English
|
1049
|
+
- locale_id:
|
1050
|
+
code: en
|
1051
|
+
name: pt
|
1052
|
+
value: Portuguese
|
1053
|
+
- locale_id:
|
1054
|
+
code: pt
|
1055
|
+
name: en
|
1056
|
+
value: Inglês
|
1057
|
+
- locale_id:
|
1058
|
+
code: pt
|
1059
|
+
name: pt
|
1060
|
+
value: Português
|
package/package.json
CHANGED
@@ -63,49 +63,6 @@ export class Migrate implements MigrationInterface {
|
|
63
63
|
],
|
64
64
|
}),
|
65
65
|
);
|
66
|
-
|
67
|
-
const countryUSA = await queryRunner.manager
|
68
|
-
.createQueryBuilder()
|
69
|
-
.select()
|
70
|
-
.from('countries', 'c')
|
71
|
-
.where('code = :code', { code: 'USA' })
|
72
|
-
.execute();
|
73
|
-
const countryBRA = await queryRunner.manager
|
74
|
-
.createQueryBuilder()
|
75
|
-
.select()
|
76
|
-
.from('countries', 'c')
|
77
|
-
.where('code = :code', { code: 'BRA' })
|
78
|
-
.execute();
|
79
|
-
|
80
|
-
const locales = [
|
81
|
-
{
|
82
|
-
id: 0,
|
83
|
-
code: 'en',
|
84
|
-
region: 'US',
|
85
|
-
country_id: countryUSA[0].id,
|
86
|
-
},
|
87
|
-
{
|
88
|
-
id: 0,
|
89
|
-
code: 'pt',
|
90
|
-
region: 'BR',
|
91
|
-
country_id: countryBRA[0].id,
|
92
|
-
},
|
93
|
-
];
|
94
|
-
|
95
|
-
for (let index = 0; index < locales.length; index++) {
|
96
|
-
const localeId = await queryRunner.manager
|
97
|
-
.createQueryBuilder()
|
98
|
-
.insert()
|
99
|
-
.into('locales', ['code', 'region', 'country_id'])
|
100
|
-
.values({
|
101
|
-
code: locales[index].code,
|
102
|
-
region: locales[index].region,
|
103
|
-
country_id: locales[index].country_id,
|
104
|
-
})
|
105
|
-
.execute();
|
106
|
-
|
107
|
-
locales[index].id = localeId.raw.insertId;
|
108
|
-
}
|
109
66
|
}
|
110
67
|
|
111
68
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
@@ -25,13 +25,6 @@ export class Migrate implements MigrationInterface {
|
|
25
25
|
true,
|
26
26
|
);
|
27
27
|
|
28
|
-
await await queryRunner.manager
|
29
|
-
.createQueryBuilder()
|
30
|
-
.insert()
|
31
|
-
.into('translation_namespaces')
|
32
|
-
.values([{ name: 'translation' }])
|
33
|
-
.execute();
|
34
|
-
|
35
28
|
await queryRunner.createTable(
|
36
29
|
new Table({
|
37
30
|
name: 'translations',
|
@@ -75,50 +68,6 @@ export class Migrate implements MigrationInterface {
|
|
75
68
|
}),
|
76
69
|
true,
|
77
70
|
);
|
78
|
-
|
79
|
-
await await queryRunner.manager
|
80
|
-
.createQueryBuilder()
|
81
|
-
.insert()
|
82
|
-
.into('translations', ['locale_id', 'namespace_id', 'name', 'value'])
|
83
|
-
.values([
|
84
|
-
{
|
85
|
-
locale_id: 1,
|
86
|
-
namespace_id: 1,
|
87
|
-
name: 'slogan',
|
88
|
-
value: 'Administration Panel',
|
89
|
-
},
|
90
|
-
{
|
91
|
-
locale_id: 1,
|
92
|
-
namespace_id: 1,
|
93
|
-
name: 'en',
|
94
|
-
value: 'English',
|
95
|
-
},
|
96
|
-
{
|
97
|
-
locale_id: 1,
|
98
|
-
namespace_id: 1,
|
99
|
-
name: 'pt',
|
100
|
-
value: 'Portuguese',
|
101
|
-
},
|
102
|
-
{
|
103
|
-
locale_id: 2,
|
104
|
-
namespace_id: 1,
|
105
|
-
name: 'slogan',
|
106
|
-
value: 'Painel de Administração',
|
107
|
-
},
|
108
|
-
{
|
109
|
-
locale_id: 2,
|
110
|
-
namespace_id: 1,
|
111
|
-
name: 'en',
|
112
|
-
value: 'Inglês',
|
113
|
-
},
|
114
|
-
{
|
115
|
-
locale_id: 2,
|
116
|
-
namespace_id: 1,
|
117
|
-
name: 'pt',
|
118
|
-
value: 'Português',
|
119
|
-
},
|
120
|
-
])
|
121
|
-
.execute();
|
122
71
|
}
|
123
72
|
|
124
73
|
public async down(queryRunner: QueryRunner): Promise<void> {
|