gg-mysql-connector 1.0.87 → 1.0.88
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.
|
@@ -71,7 +71,7 @@ class MyDBMigrator {
|
|
|
71
71
|
}
|
|
72
72
|
async alterUniqueColumnCombination(tableName, uniqueColumnCombination) {
|
|
73
73
|
if (uniqueColumnCombination === null || uniqueColumnCombination === void 0 ? void 0 : uniqueColumnCombination.length) {
|
|
74
|
-
|
|
74
|
+
for (let row of uniqueColumnCombination) {
|
|
75
75
|
const isCompositeUniqueNameExist = await this.isCompositeUniqueColumnExist(tableName, row);
|
|
76
76
|
// check is exist, then drop it first
|
|
77
77
|
if (isCompositeUniqueNameExist) {
|
|
@@ -80,7 +80,7 @@ class MyDBMigrator {
|
|
|
80
80
|
const compositeUniqueName = this.getCompositeUniqueName(row);
|
|
81
81
|
const temp = row.columnName.join(",");
|
|
82
82
|
await this.MyDB.query(`ALTER TABLE ${tableName} ADD UNIQUE KEY ${compositeUniqueName} (${temp})`);
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
async alterDataType(tableName, col) {
|
package/package.json
CHANGED
|
@@ -111,7 +111,7 @@ export default class MyDBMigrator {
|
|
|
111
111
|
uniqueColumnCombination: MyModel["compoisteUniqueColumn"]
|
|
112
112
|
) {
|
|
113
113
|
if (uniqueColumnCombination?.length) {
|
|
114
|
-
|
|
114
|
+
for (let row of uniqueColumnCombination) {
|
|
115
115
|
const isCompositeUniqueNameExist =
|
|
116
116
|
await this.isCompositeUniqueColumnExist(tableName, row)
|
|
117
117
|
// check is exist, then drop it first
|
|
@@ -127,7 +127,7 @@ export default class MyDBMigrator {
|
|
|
127
127
|
await this.MyDB.query(
|
|
128
128
|
`ALTER TABLE ${tableName} ADD UNIQUE KEY ${compositeUniqueName} (${temp})`
|
|
129
129
|
)
|
|
130
|
-
}
|
|
130
|
+
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|