mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
[ci] format
This commit is contained in:
parent
24bc169070
commit
e1477bb3d6
3 changed files with 8 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
||||||
import type { AstroConfig } from 'astro';
|
import type { AstroConfig } from 'astro';
|
||||||
|
import { red } from 'kleur/colors';
|
||||||
import type { Arguments } from 'yargs-parser';
|
import type { Arguments } from 'yargs-parser';
|
||||||
import { getManagedAppTokenOrExit } from '../../../tokens.js';
|
import { getManagedAppTokenOrExit } from '../../../tokens.js';
|
||||||
import { type DBConfig, type DBSnapshot } from '../../../types.js';
|
import { type DBConfig, type DBSnapshot } from '../../../types.js';
|
||||||
|
@ -10,7 +11,6 @@ import {
|
||||||
getMigrationQueries,
|
getMigrationQueries,
|
||||||
getProductionCurrentSnapshot,
|
getProductionCurrentSnapshot,
|
||||||
} from '../../migration-queries.js';
|
} from '../../migration-queries.js';
|
||||||
import { red } from 'kleur/colors';
|
|
||||||
|
|
||||||
export async function cmd({
|
export async function cmd({
|
||||||
dbConfig,
|
dbConfig,
|
||||||
|
|
|
@ -37,7 +37,6 @@ export async function cmd({
|
||||||
result.message = `Database schema is out of date.\nRun 'astro db push' to push up your latest changes.`;
|
result.message = `Database schema is out of date.\nRun 'astro db push' to push up your latest changes.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (confirmations.length > 0) {
|
if (confirmations.length > 0) {
|
||||||
result.code = 'DATA_LOSS';
|
result.code = 'DATA_LOSS';
|
||||||
result.exitCode = 1;
|
result.exitCode = 1;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import stripAnsi from 'strip-ansi';
|
|
||||||
import deepDiff from 'deep-diff';
|
import deepDiff from 'deep-diff';
|
||||||
import { SQLiteAsyncDialect } from 'drizzle-orm/sqlite-core';
|
import { SQLiteAsyncDialect } from 'drizzle-orm/sqlite-core';
|
||||||
import * as color from 'kleur/colors';
|
import * as color from 'kleur/colors';
|
||||||
import { customAlphabet } from 'nanoid';
|
import { customAlphabet } from 'nanoid';
|
||||||
|
import stripAnsi from 'strip-ansi';
|
||||||
import { hasPrimaryKey } from '../../runtime/index.js';
|
import { hasPrimaryKey } from '../../runtime/index.js';
|
||||||
import {
|
import {
|
||||||
getCreateIndexQueries,
|
getCreateIndexQueries,
|
||||||
|
@ -451,7 +451,9 @@ export function formatDataLossMessage(confirmations: string[], isColor = true):
|
||||||
messages.push(...confirmations.map((m, i) => color.red(` (${i + 1}) `) + m));
|
messages.push(...confirmations.map((m, i) => color.red(` (${i + 1}) `) + m));
|
||||||
messages.push(``);
|
messages.push(``);
|
||||||
messages.push(`To resolve, revert these changes or update your schema, and re-run the command.`);
|
messages.push(`To resolve, revert these changes or update your schema, and re-run the command.`);
|
||||||
messages.push(`You may also run 'astro db push --force-reset' to ignore all warnings and force-push your local database schema to production instead. All data will be lost and the database will be reset.`);
|
messages.push(
|
||||||
|
`You may also run 'astro db push --force-reset' to ignore all warnings and force-push your local database schema to production instead. All data will be lost and the database will be reset.`
|
||||||
|
);
|
||||||
let finalMessage = messages.join('\n');
|
let finalMessage = messages.join('\n');
|
||||||
if (!isColor) {
|
if (!isColor) {
|
||||||
finalMessage = stripAnsi(finalMessage);
|
finalMessage = stripAnsi(finalMessage);
|
||||||
|
|
Loading…
Reference in a new issue