@klapeks/micro-db-utils 0.0.21 → 0.0.22
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.
|
@@ -167,7 +167,6 @@ var SuperMigrations = /** @class */ (function () {
|
|
|
167
167
|
migration = todoMigrations_1[_i];
|
|
168
168
|
if (migration.table != table)
|
|
169
169
|
return [3 /*break*/, 19];
|
|
170
|
-
logger;
|
|
171
170
|
if (lastRealMigration && lastRealMigration.getTime() >= migration.date.getTime()) {
|
|
172
171
|
return [3 /*break*/, 19];
|
|
173
172
|
}
|
|
@@ -83,8 +83,10 @@ var SQLAlterCommand = /** @class */ (function () {
|
|
|
83
83
|
return [4 /*yield*/, ctx.runAdditionalSQL("\n SELECT sql FROM sqlite_master WHERE type = \"table\" AND name = \"".concat(this.table, "\";\n "))];
|
|
84
84
|
case 1:
|
|
85
85
|
tableCreateOld = (_b = (_a = (_c.sent())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.sql;
|
|
86
|
-
if (!tableCreateOld)
|
|
87
|
-
|
|
86
|
+
if (!tableCreateOld) {
|
|
87
|
+
utils_1.logger.warn("SQLite: Table for column type migration doesn't exist:", this.table);
|
|
88
|
+
return [2 /*return*/, "SELECT 1"];
|
|
89
|
+
}
|
|
88
90
|
return [4 /*yield*/, ctx.runAdditionalSQL("\n SELECT sql FROM sqlite_master WHERE type = \"index\"\n AND tbl_name = \"".concat(this.table, "\" AND sql IS NOT NULL;\n "))];
|
|
89
91
|
case 2:
|
|
90
92
|
indexesToRecreate = (_c.sent()).map(function (s) { return s.sql || s; }).filter(Boolean).join("; ") + ';';
|