mirror of
https://github.com/withastro/astro.git
synced 2025-01-23 19:02:14 -05:00
[ci] format
This commit is contained in:
parent
28e7535e5c
commit
4e7f5f8951
2 changed files with 13 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
||||||
import type { AstroConfig } from 'astro';
|
import type { AstroConfig } from 'astro';
|
||||||
|
import prompts from 'prompts';
|
||||||
import type { Arguments } from 'yargs-parser';
|
import type { Arguments } from 'yargs-parser';
|
||||||
import { safeFetch } from '../../../../runtime/utils.js';
|
import { safeFetch } from '../../../../runtime/utils.js';
|
||||||
import { MIGRATION_VERSION } from '../../../consts.js';
|
import { MIGRATION_VERSION } from '../../../consts.js';
|
||||||
|
@ -12,7 +13,6 @@ import {
|
||||||
getMigrationQueries,
|
getMigrationQueries,
|
||||||
getProductionCurrentSnapshot,
|
getProductionCurrentSnapshot,
|
||||||
} from '../../migration-queries.js';
|
} from '../../migration-queries.js';
|
||||||
import prompts from 'prompts';
|
|
||||||
|
|
||||||
export async function cmd({
|
export async function cmd({
|
||||||
dbConfig,
|
dbConfig,
|
||||||
|
@ -42,17 +42,17 @@ export async function cmd({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isForceReset) {
|
if (isForceReset) {
|
||||||
const { begin } = await prompts({
|
const { begin } = await prompts({
|
||||||
type: "confirm",
|
type: 'confirm',
|
||||||
name: "begin",
|
name: 'begin',
|
||||||
message: `Reset your database? All of your data will be erased and your schema created from scratch.`,
|
message: `Reset your database? All of your data will be erased and your schema created from scratch.`,
|
||||||
initial: false
|
initial: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!begin) {
|
if (!begin) {
|
||||||
console.log("Canceled.");
|
console.log('Canceled.');
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Force-pushing to the database. All existing data will be erased.`);
|
console.log(`Force-pushing to the database. All existing data will be erased.`);
|
||||||
} else if (confirmations.length > 0) {
|
} else if (confirmations.length > 0) {
|
||||||
|
|
|
@ -16,7 +16,8 @@ export const MISSING_EXECUTE_PATH_ERROR = `${red(
|
||||||
|
|
||||||
export const RENAME_TABLE_ERROR = (oldTable: string, newTable: string) => {
|
export const RENAME_TABLE_ERROR = (oldTable: string, newTable: string) => {
|
||||||
return (
|
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.
|
You cannot add and remove tables in the same schema update batch.
|
||||||
|
|
||||||
1. Use "deprecated: true" to deprecate a table before renaming.
|
1. Use "deprecated: true" to deprecate a table before renaming.
|
||||||
|
|
Loading…
Add table
Reference in a new issue