From 452a3c85813fb490073bf13d11e5f29c4c94f745 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Fri, 9 Feb 2024 10:21:25 -0800 Subject: [PATCH] prepare to run seed on all db push commands --- packages/db/src/core/cli/commands/push/index.ts | 3 ++- packages/db/src/core/queries.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/db/src/core/cli/commands/push/index.ts b/packages/db/src/core/cli/commands/push/index.ts index 5809f0e7d1..a172ef83e4 100644 --- a/packages/db/src/core/cli/commands/push/index.ts +++ b/packages/db/src/core/cli/commands/push/index.ts @@ -60,7 +60,8 @@ export async function cmd({ config, flags }: { config: AstroConfig; flags: Argum // exit early if there are no migrations to push if (missingMigrations.length === 0) { console.log(MIGRATIONS_UP_TO_DATE); - process.exit(0); + // Preparing to seed for all runs + // process.exit(0); } // push the database schema if (missingMigrations.length > 0) { diff --git a/packages/db/src/core/queries.ts b/packages/db/src/core/queries.ts index bae6de518b..d64149ee84 100644 --- a/packages/db/src/core/queries.ts +++ b/packages/db/src/core/queries.ts @@ -63,10 +63,11 @@ export async function setupDbTables({ db, mode, }); - } catch (e) { + } catch (error) { (logger ?? console).error( - `Failed to seed data. Did you update to match recent schema changes? Full error:\n\n${e}` + `Failed to seed data. Did you update to match recent schema changes?` ); + (logger ?? console).error(error as string); } } }