glimr/db/gen/migrate/cleanup

Migration Cleanup

After a migration is generated, rename_from modifiers in schema files have done their job — they told the differ to emit RENAME COLUMN instead of drop+add. If left in place they’d fire again on the next run and generate a duplicate rename that fails at migration time. This module strips them out automatically so developers don’t have to remember to clean up after themselves.

Values

pub fn clean_rename_from_modifiers(models_path: String) -> Nil

Called right after migration generation. If a developer forgets to remove rename_from from their schema, the next migration run would see the same rename again and emit a duplicate RENAME COLUMN that crashes. Rather than relying on developers to remember, we just clean it up for them — find every schema file, strip the pipes, tidy the imports, and reformat.

Search Document