Home / Function/ formatDataLossMessage() — astro Function Reference

formatDataLossMessage() — astro Function Reference

Architecture documentation for the formatDataLossMessage() function in migration-queries.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  614c77eb_4ac3_14c8_05f9_f3410c3ca9dd["formatDataLossMessage()"]
  d1459290_7e42_1f92_05bd_dcc3aeda9fd3["migration-queries.ts"]
  614c77eb_4ac3_14c8_05f9_f3410c3ca9dd -->|defined in| d1459290_7e42_1f92_05bd_dcc3aeda9fd3
  style 614c77eb_4ac3_14c8_05f9_f3410c3ca9dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/src/core/cli/migration-queries.ts lines 490–505

export function formatDataLossMessage(confirmations: string[], isColor = true): string {
	const messages = [];
	messages.push(color.red('✖ We found some schema changes that cannot be handled automatically:'));
	messages.push(``);
	messages.push(...confirmations.map((m, i) => color.red(`  (${i + 1}) `) + m));
	messages.push(``);
	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.`,
	);
	let finalMessage = messages.join('\n');
	if (!isColor) {
		finalMessage = stripVTControlCharacters(finalMessage);
	}
	return finalMessage;
}

Domain

Subdomains

Frequently Asked Questions

What does formatDataLossMessage() do?
formatDataLossMessage() is a function in the astro codebase, defined in packages/db/src/core/cli/migration-queries.ts.
Where is formatDataLossMessage() defined?
formatDataLossMessage() is defined in packages/db/src/core/cli/migration-queries.ts at line 490.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free