Google News
logo
FuelPHP - Interview Questions
What about Migrations in FuelPHP?
Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run them. You’d also have to keep track of which changes need to be run against the production machines next time you deploy.
 
The database table `migration` tracks which migrations have already been run so all you have to do is update your application files and call Migrate::current() to work out which migrations should be run. The current version is found in core/config/migration.php so like any other config file you should copy this to app/config to make changes.

Key Type Default Description
folder string
'migrations/'
The folder in which migration files will be found.
connection string
null
Configuration name of a database connection to use to write migrations.
table string
'migration'
The database table used to store migration data.
flush_cache boolean
false
If true, all cached data will be erased after all migrations have run, via a call to Cache::delete_all().
Advertisement