gg-mysql-connector 1.0.89 → 1.0.91
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.
|
@@ -27,8 +27,8 @@ class MyDBMigrator {
|
|
|
27
27
|
await this.alterIndex(row.tableName, col.COLUMN_NAME, col.IS_INDEX);
|
|
28
28
|
await this.alterPossibleEnum(row.tableName, col.COLUMN_NAME, col.POSSIBLE_VALUE);
|
|
29
29
|
await this.alterForeignKey(row.tableName, col);
|
|
30
|
-
await this.alterUniqueColumnCombination(row.tableName, row.compoisteUniqueColumn);
|
|
31
30
|
}
|
|
31
|
+
await this.alterUniqueColumnCombination(row.tableName, row.compoisteUniqueColumn);
|
|
32
32
|
}
|
|
33
33
|
console.log("migrate table done");
|
|
34
34
|
}
|
|
@@ -55,7 +55,7 @@ class MyDBMigrator {
|
|
|
55
55
|
async alterForeignKey(tableName, col) {
|
|
56
56
|
if (col.FOREIGN_KEY) {
|
|
57
57
|
for (const row of col.FOREIGN_KEY) {
|
|
58
|
-
const CONSTRAINT = `fk_${tableName}_${col.COLUMN_NAME}_${row.tableName}_${row.columnName}
|
|
58
|
+
const CONSTRAINT = `fk_${tableName}_${col.COLUMN_NAME}_${row.tableName}_${row.columnName}`.slice(0, 64);
|
|
59
59
|
const constraintExist = await this.isConstraintNameExist(CONSTRAINT);
|
|
60
60
|
if (constraintExist) {
|
|
61
61
|
await this.MyDB.query(`ALTER TABLE ${tableName} DROP FOREIGN KEY ${CONSTRAINT}`);
|
package/package.json
CHANGED
|
@@ -44,11 +44,11 @@ export default class MyDBMigrator {
|
|
|
44
44
|
col.POSSIBLE_VALUE
|
|
45
45
|
)
|
|
46
46
|
await this.alterForeignKey(row.tableName, col)
|
|
47
|
-
await this.alterUniqueColumnCombination(
|
|
48
|
-
row.tableName,
|
|
49
|
-
row.compoisteUniqueColumn
|
|
50
|
-
)
|
|
51
47
|
}
|
|
48
|
+
await this.alterUniqueColumnCombination(
|
|
49
|
+
row.tableName,
|
|
50
|
+
row.compoisteUniqueColumn
|
|
51
|
+
)
|
|
52
52
|
}
|
|
53
53
|
console.log("migrate table done")
|
|
54
54
|
}
|
|
@@ -89,7 +89,11 @@ export default class MyDBMigrator {
|
|
|
89
89
|
) {
|
|
90
90
|
if (col.FOREIGN_KEY) {
|
|
91
91
|
for (const row of col.FOREIGN_KEY) {
|
|
92
|
-
const CONSTRAINT =
|
|
92
|
+
const CONSTRAINT =
|
|
93
|
+
`fk_${tableName}_${col.COLUMN_NAME}_${row.tableName}_${row.columnName}`.slice(
|
|
94
|
+
0,
|
|
95
|
+
64
|
|
96
|
+
)
|
|
93
97
|
|
|
94
98
|
const constraintExist = await this.isConstraintNameExist(CONSTRAINT)
|
|
95
99
|
if (constraintExist) {
|