mysqlsyncr 1.0.72 → 1.0.74
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/dist/index.cjs +45 -41
- package/dist/index.js +45 -41
- package/package.json +1 -1
- package/src/differences.js +4 -3
package/dist/index.cjs
CHANGED
|
@@ -3259,49 +3259,53 @@ var findDifferences = function findDifferences(expected, current) {
|
|
|
3259
3259
|
_step2;
|
|
3260
3260
|
try {
|
|
3261
3261
|
var _loop = function _loop() {
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
});
|
|
3266
|
-
if (!currentField) {
|
|
3267
|
-
console.error('Current field not found for', field.Field, 'in table', _tableName);
|
|
3268
|
-
differences.push({
|
|
3269
|
-
type: 'missing_field',
|
|
3270
|
-
tableName: _tableName,
|
|
3271
|
-
field: field
|
|
3272
|
-
});
|
|
3273
|
-
return 1; // continue
|
|
3274
|
-
}
|
|
3275
|
-
if (field.Type !== currentField.Type) {
|
|
3276
|
-
differences.push({
|
|
3277
|
-
type: 'mismatched_field',
|
|
3278
|
-
info: "Type",
|
|
3279
|
-
tableName: _tableName,
|
|
3280
|
-
field: field,
|
|
3281
|
-
currentField: currentField
|
|
3282
|
-
});
|
|
3283
|
-
}
|
|
3284
|
-
if (field.Null !== currentField.Null) {
|
|
3285
|
-
differences.push({
|
|
3286
|
-
type: 'mismatched_field',
|
|
3287
|
-
info: "Null",
|
|
3288
|
-
tableName: _tableName,
|
|
3289
|
-
field: field,
|
|
3290
|
-
currentField: currentField
|
|
3262
|
+
var field = _step2.value;
|
|
3263
|
+
var currentField = current.tables[_tableName].columns.find(function (f) {
|
|
3264
|
+
return f.Field === field.Field;
|
|
3291
3265
|
});
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3266
|
+
if (!currentField) {
|
|
3267
|
+
console.error('Current field not found for', field.Field, 'in table', _tableName);
|
|
3268
|
+
differences.push({
|
|
3269
|
+
type: 'missing_field',
|
|
3270
|
+
tableName: _tableName,
|
|
3271
|
+
field: field
|
|
3272
|
+
});
|
|
3273
|
+
return 0; // continue
|
|
3274
|
+
}
|
|
3275
|
+
if (field.Null !== currentField.Null) {
|
|
3276
|
+
differences.push({
|
|
3277
|
+
type: 'mismatched_field',
|
|
3278
|
+
info: "Null",
|
|
3279
|
+
tableName: _tableName,
|
|
3280
|
+
field: field,
|
|
3281
|
+
currentField: currentField
|
|
3282
|
+
});
|
|
3283
|
+
}
|
|
3284
|
+
if (field.Default !== currentField.Default) {
|
|
3285
|
+
differences.push({
|
|
3286
|
+
type: 'mismatched_field',
|
|
3287
|
+
info: "Default",
|
|
3288
|
+
tableName: _tableName,
|
|
3289
|
+
field: field,
|
|
3290
|
+
currentField: currentField
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3293
|
+
if (field.Type !== currentField.Type) {
|
|
3294
|
+
if (field.Type == 'int' && currentField.Type == 'int(11)') return 0; // continue
|
|
3295
|
+
// int(11) is the default for int and used on older versions of mysql
|
|
3296
|
+
differences.push({
|
|
3297
|
+
type: 'mismatched_field',
|
|
3298
|
+
info: "Type",
|
|
3299
|
+
tableName: _tableName,
|
|
3300
|
+
field: field,
|
|
3301
|
+
currentField: currentField
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
_ret;
|
|
3303
3306
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3304
|
-
|
|
3307
|
+
_ret = _loop();
|
|
3308
|
+
if (_ret === 0) continue;
|
|
3305
3309
|
}
|
|
3306
3310
|
|
|
3307
3311
|
// verify indexes
|
package/dist/index.js
CHANGED
|
@@ -3256,49 +3256,53 @@ var findDifferences = function findDifferences(expected, current) {
|
|
|
3256
3256
|
_step2;
|
|
3257
3257
|
try {
|
|
3258
3258
|
var _loop = function _loop() {
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
});
|
|
3263
|
-
if (!currentField) {
|
|
3264
|
-
console.error('Current field not found for', field.Field, 'in table', _tableName);
|
|
3265
|
-
differences.push({
|
|
3266
|
-
type: 'missing_field',
|
|
3267
|
-
tableName: _tableName,
|
|
3268
|
-
field: field
|
|
3269
|
-
});
|
|
3270
|
-
return 1; // continue
|
|
3271
|
-
}
|
|
3272
|
-
if (field.Type !== currentField.Type) {
|
|
3273
|
-
differences.push({
|
|
3274
|
-
type: 'mismatched_field',
|
|
3275
|
-
info: "Type",
|
|
3276
|
-
tableName: _tableName,
|
|
3277
|
-
field: field,
|
|
3278
|
-
currentField: currentField
|
|
3279
|
-
});
|
|
3280
|
-
}
|
|
3281
|
-
if (field.Null !== currentField.Null) {
|
|
3282
|
-
differences.push({
|
|
3283
|
-
type: 'mismatched_field',
|
|
3284
|
-
info: "Null",
|
|
3285
|
-
tableName: _tableName,
|
|
3286
|
-
field: field,
|
|
3287
|
-
currentField: currentField
|
|
3259
|
+
var field = _step2.value;
|
|
3260
|
+
var currentField = current.tables[_tableName].columns.find(function (f) {
|
|
3261
|
+
return f.Field === field.Field;
|
|
3288
3262
|
});
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
|
|
3263
|
+
if (!currentField) {
|
|
3264
|
+
console.error('Current field not found for', field.Field, 'in table', _tableName);
|
|
3265
|
+
differences.push({
|
|
3266
|
+
type: 'missing_field',
|
|
3267
|
+
tableName: _tableName,
|
|
3268
|
+
field: field
|
|
3269
|
+
});
|
|
3270
|
+
return 0; // continue
|
|
3271
|
+
}
|
|
3272
|
+
if (field.Null !== currentField.Null) {
|
|
3273
|
+
differences.push({
|
|
3274
|
+
type: 'mismatched_field',
|
|
3275
|
+
info: "Null",
|
|
3276
|
+
tableName: _tableName,
|
|
3277
|
+
field: field,
|
|
3278
|
+
currentField: currentField
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
if (field.Default !== currentField.Default) {
|
|
3282
|
+
differences.push({
|
|
3283
|
+
type: 'mismatched_field',
|
|
3284
|
+
info: "Default",
|
|
3285
|
+
tableName: _tableName,
|
|
3286
|
+
field: field,
|
|
3287
|
+
currentField: currentField
|
|
3288
|
+
});
|
|
3289
|
+
}
|
|
3290
|
+
if (field.Type !== currentField.Type) {
|
|
3291
|
+
if (field.Type == 'int' && currentField.Type == 'int(11)') return 0; // continue
|
|
3292
|
+
// int(11) is the default for int and used on older versions of mysql
|
|
3293
|
+
differences.push({
|
|
3294
|
+
type: 'mismatched_field',
|
|
3295
|
+
info: "Type",
|
|
3296
|
+
tableName: _tableName,
|
|
3297
|
+
field: field,
|
|
3298
|
+
currentField: currentField
|
|
3299
|
+
});
|
|
3300
|
+
}
|
|
3301
|
+
},
|
|
3302
|
+
_ret;
|
|
3300
3303
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3301
|
-
|
|
3304
|
+
_ret = _loop();
|
|
3305
|
+
if (_ret === 0) continue;
|
|
3302
3306
|
}
|
|
3303
3307
|
|
|
3304
3308
|
// verify indexes
|
package/package.json
CHANGED
package/src/differences.js
CHANGED
|
@@ -63,15 +63,16 @@ export const findDifferences = (expected, current) => {
|
|
|
63
63
|
differences.push({ type: 'missing_field', tableName, field });
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
|
-
if (field.Type !== currentField.Type) {
|
|
67
|
-
differences.push({ type: 'mismatched_field', info: "Type", tableName, field, currentField });
|
|
68
|
-
}
|
|
69
66
|
if (field.Null !== currentField.Null) {
|
|
70
67
|
differences.push({ type: 'mismatched_field', info: "Null", tableName, field, currentField });
|
|
71
68
|
}
|
|
72
69
|
if (field.Default !== currentField.Default) {
|
|
73
70
|
differences.push({ type: 'mismatched_field', info: "Default", tableName, field, currentField });
|
|
74
71
|
}
|
|
72
|
+
if (field.Type !== currentField.Type) {
|
|
73
|
+
if(field.Type == 'int' && currentField.Type == 'int(11)') continue; // int(11) is the default for int and used on older versions of mysql
|
|
74
|
+
differences.push({ type: 'mismatched_field', info: "Type", tableName, field, currentField });
|
|
75
|
+
}
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
// verify indexes
|