@hedhog/admin 0.0.70 → 0.0.71
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-01.ts +29 -29
package/package.json
CHANGED
@@ -23,13 +23,26 @@ export class Migrate implements MigrationInterface {
|
|
23
23
|
|
24
24
|
await queryRunner.createTable(
|
25
25
|
new Table({
|
26
|
-
name: '
|
26
|
+
name: 'locales',
|
27
27
|
columns: [
|
28
|
-
|
29
|
-
foreignColumn({ name: '
|
28
|
+
idColumn(),
|
29
|
+
foreignColumn({ name: 'country_id' }),
|
30
30
|
{
|
31
|
-
name: '
|
32
|
-
type: '
|
31
|
+
name: 'code',
|
32
|
+
type: 'char',
|
33
|
+
length: '2',
|
34
|
+
isNullable: false,
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'region',
|
38
|
+
type: 'char',
|
39
|
+
length: '2',
|
40
|
+
isNullable: false,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: 'enabled',
|
44
|
+
type: 'boolean',
|
45
|
+
default: true,
|
33
46
|
},
|
34
47
|
timestampColumn(),
|
35
48
|
timestampColumn('updated_at'),
|
@@ -41,38 +54,19 @@ export class Migrate implements MigrationInterface {
|
|
41
54
|
referencedTableName: 'countries',
|
42
55
|
onDelete: 'CASCADE',
|
43
56
|
},
|
44
|
-
{
|
45
|
-
columnNames: ['locale_id'],
|
46
|
-
referencedColumnNames: ['id'],
|
47
|
-
referencedTableName: 'locales',
|
48
|
-
onDelete: 'CASCADE',
|
49
|
-
},
|
50
57
|
],
|
51
58
|
}),
|
52
59
|
);
|
53
60
|
|
54
61
|
await queryRunner.createTable(
|
55
62
|
new Table({
|
56
|
-
name: '
|
63
|
+
name: 'country_translations',
|
57
64
|
columns: [
|
58
|
-
|
59
|
-
foreignColumn({ name: '
|
60
|
-
{
|
61
|
-
name: 'code',
|
62
|
-
type: 'char',
|
63
|
-
length: '2',
|
64
|
-
isNullable: false,
|
65
|
-
},
|
66
|
-
{
|
67
|
-
name: 'region',
|
68
|
-
type: 'char',
|
69
|
-
length: '2',
|
70
|
-
isNullable: false,
|
71
|
-
},
|
65
|
+
foreignColumn({ name: 'country_id', isPrimary: true }),
|
66
|
+
foreignColumn({ name: 'locale_id', isPrimary: true }),
|
72
67
|
{
|
73
|
-
name: '
|
74
|
-
type: '
|
75
|
-
default: true,
|
68
|
+
name: 'name',
|
69
|
+
type: 'varchar',
|
76
70
|
},
|
77
71
|
timestampColumn(),
|
78
72
|
timestampColumn('updated_at'),
|
@@ -84,6 +78,12 @@ export class Migrate implements MigrationInterface {
|
|
84
78
|
referencedTableName: 'countries',
|
85
79
|
onDelete: 'CASCADE',
|
86
80
|
},
|
81
|
+
{
|
82
|
+
columnNames: ['locale_id'],
|
83
|
+
referencedColumnNames: ['id'],
|
84
|
+
referencedTableName: 'locales',
|
85
|
+
onDelete: 'CASCADE',
|
86
|
+
},
|
87
87
|
],
|
88
88
|
}),
|
89
89
|
);
|