angel-dart-archive / orm

moved to angel-dart/angel/packages/orm

Home Page:https://github.com/angel-dart/angel/tree/master/packages/orm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to change a table with migrations

sanmadjack opened this issue · comments

How do we apply a migration that does something like adds a column to a table without having to wipe out the database?

The Schema class has an alter method. Any column declared within the closure you pass are executed as ALTER commands:
https://pub.dartlang.org/documentation/angel_migration/latest/angel_migration/Schema/alter.html

If you find that you are often changing your schemes often, and would like to manually write your migrations, instead of having them automatically generated, replace the @orm annotation with @Orm(generateMigrations: false).