Home / Function/ updateUpToV6() — drizzle-orm Function Reference

updateUpToV6() — drizzle-orm Function Reference

Architecture documentation for the updateUpToV6() function in pgUp.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  db63d11a_f28c_6301_37b3_f7c59b7ccf7f["updateUpToV6()"]
  466af62c_27ae_41b6_d841_1dc8334565a4["pgUp.ts"]
  db63d11a_f28c_6301_37b3_f7c59b7ccf7f -->|defined in| 466af62c_27ae_41b6_d841_1dc8334565a4
  b88883be_9aee_d2b0_1c78_5ac04683bbbf["upPgHandler()"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|calls| db63d11a_f28c_6301_37b3_f7c59b7ccf7f
  style db63d11a_f28c_6301_37b3_f7c59b7ccf7f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/cli/commands/pgUp.ts lines 44–73

export const updateUpToV6 = (json: Record<string, any>): PgSchemaV6 => {
	const schema = pgSchemaV5.parse(json);
	const tables = Object.fromEntries(
		Object.entries(schema.tables).map((it) => {
			const table = it[1];
			const schema = table.schema || 'public';
			return [`${schema}.${table.name}`, table];
		}),
	);
	const enums = Object.fromEntries(
		Object.entries(schema.enums).map((it) => {
			const en = it[1];
			return [
				`public.${en.name}`,
				{
					name: en.name,
					schema: 'public',
					values: Object.values(en.values),
				},
			];
		}),
	);
	return {
		...schema,
		version: '6',
		dialect: 'postgresql',
		tables: tables,
		enums,
	};
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateUpToV6() do?
updateUpToV6() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/pgUp.ts.
Where is updateUpToV6() defined?
updateUpToV6() is defined in drizzle-kit/src/cli/commands/pgUp.ts at line 44.
What calls updateUpToV6()?
updateUpToV6() is called by 1 function(s): upPgHandler.

Analyze Your Own Codebase

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

Try Supermodel Free