( prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON, )
| 382 | }; |
| 383 | |
| 384 | export 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 | |
| 409 | export const pushMySQLSchema = async ( |
| 410 | imports: Record<string, unknown>, |
nothing calls this directly
no test coverage detected