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

updateUpToV7() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

drizzle-kit/src/cli/commands/pgUp.ts lines 76–110

export const updateUpToV7 = (json: Record<string, any>): PgSchema => {
	const schema = pgSchemaV6.parse(json);
	const tables = Object.fromEntries(
		Object.entries(schema.tables).map((it) => {
			const table = it[1];
			const mappedIndexes = Object.fromEntries(
				Object.entries(table.indexes).map((idx) => {
					const { columns, ...rest } = idx[1];
					const mappedColumns = columns.map<Index['columns'][number]>((it) => {
						return {
							expression: it,
							isExpression: false,
							asc: true,
							nulls: 'last',
							opClass: undefined,
						};
					});
					return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
				}),
			);
			return [it[0], { ...table, indexes: mappedIndexes, policies: {}, isRLSEnabled: false, checkConstraints: {} }];
		}),
	);

	return {
		...schema,
		version: '7',
		dialect: 'postgresql',
		sequences: {},
		tables: tables,
		policies: {},
		views: {},
		roles: {},
	};
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateUpToV7() do?
updateUpToV7() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/pgUp.ts.
Where is updateUpToV7() defined?
updateUpToV7() is defined in drizzle-kit/src/cli/commands/pgUp.ts at line 76.
What calls updateUpToV7()?
updateUpToV7() 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