Mysql & SQLite Migration
Finch provides a simple way to manage your database migrations. You can use the migrate (for mysql) or migrate_sqlite (for sqlite) command to manage your database migrations. This command provides the following options:
--initor-i: Initializes the migration table and executes all pending migrations.--createor-c: Creates a new migration file template.--nameor-n: Name of migration file while creating.--rollbackor-r: Rolls back the most recent migrations.--listor-l: Lists all migration files and their status.
This commands are available after you run the app (or while running the app in console mode). you can use the migrate command in your app.dart file. for example:
Add new migration file
You can add a new migration file by using the --create or -c option. for example:
Migration file template
Migration file template is a simple sql file that contains two sections: