orange-dragonfly-orm-model-to-sql 0.7.3 → 0.7.4
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/package.json +1 -1
- package/src/mysql.js +1 -1
package/package.json
CHANGED
package/src/mysql.js
CHANGED
|
@@ -110,7 +110,7 @@ class OrangeDragonflyORMSchemaToMySQL {
|
|
|
110
110
|
const queries = []
|
|
111
111
|
for (let [index, is_unique] of Object.entries(indexes)) {
|
|
112
112
|
if (is_unique) {
|
|
113
|
-
queries.push(`CREATE UNIQUE INDEX uq_${index.
|
|
113
|
+
queries.push(`CREATE UNIQUE INDEX uq_${index.replaceAll('.', '__').replaceAll('/', '___')} ON ${index.split('/')[0].split('.')[0]} (${index.split('/').map(v => v.split('.')[1]).join(', ')});`)
|
|
114
114
|
} else {
|
|
115
115
|
queries.push(`CREATE INDEX ix_${index.replace('.', '__')} ON ${index.split('.')[0]} (${index.split('.')[1]});`)
|
|
116
116
|
}
|