@stacksjs/buddy 0.70.109 → 0.70.110
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/commands/migrate.js +12 -7
- package/package.json +1 -1
package/dist/commands/migrate.js
CHANGED
|
@@ -244,22 +244,27 @@ export function migrate(buddy) {
|
|
|
244
244
|
if (options.auth !== !1) {
|
|
245
245
|
log.debug("Migrating auth tables...");
|
|
246
246
|
try {
|
|
247
|
-
const { migrateAuthTables
|
|
247
|
+
const { migrateAuthTables } = await import("@stacksjs/database"), authResult = await migrateAuthTables({ verbose: options.verbose });
|
|
248
248
|
if (!authResult.success)
|
|
249
249
|
log.error(`Failed to migrate auth tables: ${authResult.error}`);
|
|
250
|
-
|
|
250
|
+
} catch (error) {
|
|
251
|
+
log.error("Failed to migrate auth tables:", error);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const result = await runAction(Action.Migrate, options).finally(() => lock.release());
|
|
255
|
+
if (result.isErr)
|
|
256
|
+
log.error("Model migrations failed \u2014 applying notification/RBAC table guarantees before exiting.");
|
|
257
|
+
if (options.auth !== !1)
|
|
258
|
+
try {
|
|
259
|
+
const { migrateNotificationTables, migrateRbacTables } = await import("@stacksjs/database"), notifResult = await migrateNotificationTables({ verbose: options.verbose });
|
|
251
260
|
if (!notifResult.success)
|
|
252
261
|
log.error(`Failed to migrate notification tables: ${notifResult.error}`);
|
|
253
262
|
const rbacResult = await migrateRbacTables({ verbose: options.verbose });
|
|
254
263
|
if (!rbacResult.success)
|
|
255
264
|
log.error(`Failed to migrate RBAC tables: ${rbacResult.error}`);
|
|
256
265
|
} catch (error) {
|
|
257
|
-
log.error("Failed to migrate
|
|
266
|
+
log.error("Failed to migrate notification/RBAC tables:", error);
|
|
258
267
|
}
|
|
259
|
-
}
|
|
260
|
-
const result = await runAction(Action.Migrate, options).finally(() => lock.release());
|
|
261
|
-
if (result.isErr)
|
|
262
|
-
log.error("Model migrations failed.");
|
|
263
268
|
if (result.isErr) {
|
|
264
269
|
await outro("While running the migrate command, there was an issue", { startTime: perf, useSeconds: !0 }, result.error);
|
|
265
270
|
process.exit(ExitCode.FatalError);
|