sqlmorpheus 0.1.9 → 0.1.10
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -151,7 +151,9 @@ var NotAllowedException = class extends Error {
|
|
|
151
151
|
message += `
|
|
152
152
|
migrations.allowMigration(${entry.version}, "${entry.tableName}", "${entry.type}");`;
|
|
153
153
|
}
|
|
154
|
-
super(message
|
|
154
|
+
super(`${message}
|
|
155
|
+
|
|
156
|
+
`);
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
|
|
@@ -188,13 +190,15 @@ var Migrations = class {
|
|
|
188
190
|
this.notAllowedChanges.push({ version: this.toVersion, tableName, type });
|
|
189
191
|
}
|
|
190
192
|
checkIfAllowed(throwIfNotAllowed) {
|
|
193
|
+
if (!this.notAllowedChanges.length)
|
|
194
|
+
return true;
|
|
191
195
|
const exception = new NotAllowedException(this.notAllowedChanges);
|
|
192
196
|
if (throwIfNotAllowed)
|
|
193
197
|
throw exception;
|
|
194
198
|
else {
|
|
195
199
|
console.error(exception.message);
|
|
200
|
+
return false;
|
|
196
201
|
}
|
|
197
|
-
return !this.notAllowedChanges.length;
|
|
198
202
|
}
|
|
199
203
|
allowMigration(version, table, ...allowedMigrations) {
|
|
200
204
|
if (version < this.fromVersion || version > this.toVersion)
|
package/dist/index.mjs
CHANGED
|
@@ -119,7 +119,9 @@ var NotAllowedException = class extends Error {
|
|
|
119
119
|
message += `
|
|
120
120
|
migrations.allowMigration(${entry.version}, "${entry.tableName}", "${entry.type}");`;
|
|
121
121
|
}
|
|
122
|
-
super(message
|
|
122
|
+
super(`${message}
|
|
123
|
+
|
|
124
|
+
`);
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
|
|
@@ -156,13 +158,15 @@ var Migrations = class {
|
|
|
156
158
|
this.notAllowedChanges.push({ version: this.toVersion, tableName, type });
|
|
157
159
|
}
|
|
158
160
|
checkIfAllowed(throwIfNotAllowed) {
|
|
161
|
+
if (!this.notAllowedChanges.length)
|
|
162
|
+
return true;
|
|
159
163
|
const exception = new NotAllowedException(this.notAllowedChanges);
|
|
160
164
|
if (throwIfNotAllowed)
|
|
161
165
|
throw exception;
|
|
162
166
|
else {
|
|
163
167
|
console.error(exception.message);
|
|
168
|
+
return false;
|
|
164
169
|
}
|
|
165
|
-
return !this.notAllowedChanges.length;
|
|
166
170
|
}
|
|
167
171
|
allowMigration(version, table, ...allowedMigrations) {
|
|
168
172
|
if (version < this.fromVersion || version > this.toVersion)
|