MCPcopy
hub / github.com/drizzle-team/drizzle-orm / generateMySQLMigration

Function generateMySQLMigration

drizzle-kit/src/api.ts:384–407  ·  view source on GitHub ↗
(
	prev: DrizzleMySQLSnapshotJSON,
	cur: DrizzleMySQLSnapshotJSON,
)

Source from the content-addressed store, hash-verified

382};
383
384export const generateMySQLMigration = async (
385 prev: DrizzleMySQLSnapshotJSON,
386 cur: DrizzleMySQLSnapshotJSON,
387) => {
388 const { applyMysqlSnapshotsDiff } = await import('./snapshotsDiffer');
389
390 const validatedPrev = mysqlSchema.parse(prev);
391 const validatedCur = mysqlSchema.parse(cur);
392
393 const squashedPrev = squashMysqlScheme(validatedPrev);
394 const squashedCur = squashMysqlScheme(validatedCur);
395
396 const { sqlStatements } = await applyMysqlSnapshotsDiff(
397 squashedPrev,
398 squashedCur,
399 tablesResolver,
400 columnsResolver,
401 mySqlViewsResolver,
402 validatedPrev,
403 validatedCur,
404 );
405
406 return sqlStatements;
407};
408
409export const pushMySQLSchema = async (
410 imports: Record<string, unknown>,

Callers

nothing calls this directly

Calls 2

squashMysqlSchemeFunction · 0.90
applyMysqlSnapshotsDiffFunction · 0.85

Tested by

no test coverage detected