diff --git a/packages/db/src/core/cli/commands/push/index.ts b/packages/db/src/core/cli/commands/push/index.ts index 40c3e795b3..377b3677f4 100644 --- a/packages/db/src/core/cli/commands/push/index.ts +++ b/packages/db/src/core/cli/commands/push/index.ts @@ -1,4 +1,5 @@ import type { AstroConfig } from 'astro'; +import prompts from 'prompts'; import type { Arguments } from 'yargs-parser'; import { safeFetch } from '../../../../runtime/utils.js'; import { MIGRATION_VERSION } from '../../../consts.js'; @@ -12,7 +13,6 @@ import { getMigrationQueries, getProductionCurrentSnapshot, } from '../../migration-queries.js'; -import prompts from 'prompts'; export async function cmd({ dbConfig, @@ -42,17 +42,17 @@ export async function cmd({ } if (isForceReset) { - const { begin } = await prompts({ - type: "confirm", - name: "begin", - message: `Reset your database? All of your data will be erased and your schema created from scratch.`, - initial: false - }); + const { begin } = await prompts({ + type: 'confirm', + name: 'begin', + message: `Reset your database? All of your data will be erased and your schema created from scratch.`, + initial: false, + }); - if(!begin) { - console.log("Canceled."); - process.exit(0); - } + if (!begin) { + console.log('Canceled.'); + process.exit(0); + } console.log(`Force-pushing to the database. All existing data will be erased.`); } else if (confirmations.length > 0) { diff --git a/packages/db/src/core/errors.ts b/packages/db/src/core/errors.ts index c27b0cba75..620b2b985f 100644 --- a/packages/db/src/core/errors.ts +++ b/packages/db/src/core/errors.ts @@ -16,7 +16,8 @@ export const MISSING_EXECUTE_PATH_ERROR = `${red( export const RENAME_TABLE_ERROR = (oldTable: string, newTable: string) => { return ( - red("\u25B6 Potential table rename detected: " + oldTable + " -> " + newTable) + ` + red('\u25B6 Potential table rename detected: ' + oldTable + ' -> ' + newTable) + + ` You cannot add and remove tables in the same schema update batch. 1. Use "deprecated: true" to deprecate a table before renaming.