mysqlsyncr 1.0.72 → 1.0.76
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 +52 -41
- package/dist/index.js +52 -41
- package/package.json +1 -1
- package/src/differences.js +8 -3
package/dist/index.cjs
CHANGED
|
@@ -3259,49 +3259,60 @@ 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
|
+
if (field.Type == 'smallint' && currentField.Type.startsWith('smallint(')) return 0; // continue
|
|
3297
|
+
// smallint(6) is the default for smallint and used on older versions of mysql
|
|
3298
|
+
if (field.Type == 'tinyint' && currentField.Type.startsWith('tinyint(')) return 0; // continue
|
|
3299
|
+
// tinyint(1) is the default for tinyint and used on older versions of mysql
|
|
3300
|
+
if (field.Type == 'varchar' && currentField.Type.startsWith('varchar(')) return 0; // continue
|
|
3301
|
+
// varchar(255) is the default for varchar and used on older versions of mysql
|
|
3302
|
+
|
|
3303
|
+
differences.push({
|
|
3304
|
+
type: 'mismatched_field',
|
|
3305
|
+
info: "Type",
|
|
3306
|
+
tableName: _tableName,
|
|
3307
|
+
field: field,
|
|
3308
|
+
currentField: currentField
|
|
3309
|
+
});
|
|
3310
|
+
}
|
|
3311
|
+
},
|
|
3312
|
+
_ret;
|
|
3303
3313
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3304
|
-
|
|
3314
|
+
_ret = _loop();
|
|
3315
|
+
if (_ret === 0) continue;
|
|
3305
3316
|
}
|
|
3306
3317
|
|
|
3307
3318
|
// verify indexes
|
package/dist/index.js
CHANGED
|
@@ -3256,49 +3256,60 @@ 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
|
+
if (field.Type == 'smallint' && currentField.Type.startsWith('smallint(')) return 0; // continue
|
|
3294
|
+
// smallint(6) is the default for smallint and used on older versions of mysql
|
|
3295
|
+
if (field.Type == 'tinyint' && currentField.Type.startsWith('tinyint(')) return 0; // continue
|
|
3296
|
+
// tinyint(1) is the default for tinyint and used on older versions of mysql
|
|
3297
|
+
if (field.Type == 'varchar' && currentField.Type.startsWith('varchar(')) return 0; // continue
|
|
3298
|
+
// varchar(255) is the default for varchar and used on older versions of mysql
|
|
3299
|
+
|
|
3300
|
+
differences.push({
|
|
3301
|
+
type: 'mismatched_field',
|
|
3302
|
+
info: "Type",
|
|
3303
|
+
tableName: _tableName,
|
|
3304
|
+
field: field,
|
|
3305
|
+
currentField: currentField
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
},
|
|
3309
|
+
_ret;
|
|
3300
3310
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3301
|
-
|
|
3311
|
+
_ret = _loop();
|
|
3312
|
+
if (_ret === 0) continue;
|
|
3302
3313
|
}
|
|
3303
3314
|
|
|
3304
3315
|
// verify indexes
|
package/package.json
CHANGED
package/src/differences.js
CHANGED
|
@@ -63,15 +63,20 @@ 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
|
+
if(field.Type == 'smallint' && currentField.Type.startsWith('smallint(')) continue; // smallint(6) is the default for smallint and used on older versions of mysql
|
|
75
|
+
if(field.Type == 'tinyint' && currentField.Type.startsWith('tinyint(')) continue; // tinyint(1) is the default for tinyint and used on older versions of mysql
|
|
76
|
+
if(field.Type == 'varchar' && currentField.Type.startsWith('varchar(')) continue; // varchar(255) is the default for varchar and used on older versions of mysql
|
|
77
|
+
|
|
78
|
+
differences.push({ type: 'mismatched_field', info: "Type", tableName, field, currentField });
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
// verify indexes
|