Documentation / @zerotal/orm / index / generateMigrationContent
Function: generateMigrationContent()
generateMigrationContent(
className,diff):string
Defined in: packages/orm/src/schema/MigrationCodegen.ts:76
Generate the complete .ts source for a migration file from a DiffResult.
The generated file:
- Creates new tables with
Schema.create() - Adds new columns with
Schema.table()(ALTER TABLE ADD COLUMN) - Drops created tables in
down()(column additions are left for manual rollback)
Parameters
className
string
diff
Returns
string