tspace-mysql 1.4.4 → 1.4.5
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.
|
@@ -143,9 +143,11 @@ class Schema extends Builder_1.Builder {
|
|
|
143
143
|
const directories = fs_1.default.readdirSync(pathFolders, { withFileTypes: true });
|
|
144
144
|
const files = yield Promise.all(directories.map((directory) => {
|
|
145
145
|
const newDir = path_1.default.resolve(String(pathFolders), directory.name);
|
|
146
|
-
|
|
146
|
+
if (directory.isDirectory() && directory.name.toLocaleLowerCase().includes('migrations'))
|
|
147
|
+
return null;
|
|
148
|
+
return directory.isDirectory() ? Schema.sync(newDir, { force, log, delay }) : newDir;
|
|
147
149
|
}));
|
|
148
|
-
const pathModels = [].concat(...files);
|
|
150
|
+
const pathModels = [].concat(...files).filter(d => d != null || d === '');
|
|
149
151
|
yield new Promise(r => setTimeout(r, delay));
|
|
150
152
|
const promises = pathModels.map((pathModel) => Schema._syncExecute({ pathModel, force, log }));
|
|
151
153
|
yield Promise.all(promises);
|
|
@@ -183,7 +185,7 @@ class Schema extends Builder_1.Builder {
|
|
|
183
185
|
const type = (_b = (_a = schemaModel[column]) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : null;
|
|
184
186
|
const attributes = (_d = (_c = schemaModel[column]) === null || _c === void 0 ? void 0 : _c.attributes) !== null && _d !== void 0 ? _d : null;
|
|
185
187
|
if (findAfterIndex == null || type == null || attributes == null)
|
|
186
|
-
|
|
188
|
+
continue;
|
|
187
189
|
const sql = [
|
|
188
190
|
'ALTER TABLE',
|
|
189
191
|
`\`${model.getTableName()}\``,
|