forge-sql-orm 2.0.25 → 2.0.27

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.
@@ -1271,7 +1271,7 @@ const applySchemaMigrations = async (migration) => {
1271
1271
  const successfulMigrations = await migrations2.run();
1272
1272
  console.info("Migrations applied:", successfulMigrations);
1273
1273
  const migrationList = await migrationRunner.list();
1274
- const migrationHistory = Array.isArray(migrationList) && migrationList.length > 0 ? migrationList.map((y) => `${y.id}, ${y.name}, ${y.migratedAt.toUTCString()}`).join("\n") : "No migrations found";
1274
+ const migrationHistory = Array.isArray(migrationList) && migrationList.length > 0 ? migrationList.sort((a, b) => a.migratedAt.getTime() - b.migratedAt.getTime()).map((y) => `${y.id}, ${y.name}, ${y.migratedAt.toUTCString()}`).join("\n") : "No migrations found";
1275
1275
  console.info("Migrations history:\nid, name, migrated_at\n", migrationHistory);
1276
1276
  return {
1277
1277
  headers: { "Content-Type": ["application/json"] },
@@ -1280,7 +1280,12 @@ const applySchemaMigrations = async (migration) => {
1280
1280
  body: "Migrations successfully executed"
1281
1281
  };
1282
1282
  } catch (error) {
1283
- console.error("Error during migration:", error);
1283
+ try {
1284
+ console.error("Error during migration:", JSON.stringify(error));
1285
+ } catch (e) {
1286
+ console.trace("Error stringify:", e);
1287
+ console.error("Error during migration:", error);
1288
+ }
1284
1289
  return {
1285
1290
  headers: { "Content-Type": ["application/json"] },
1286
1291
  statusCode: 500,