Welcome Guest, Not a member yet? Register   Sign In
Migrations in version folders
#1

(This post was last modified: 06-23-2016, 09:10 AM by spjonez.)

In our app we extended the migration class to organize migrations into version folders. Eg;

/migrations/
/migrations/0.8.0/
/migrations/0.8.0/timestamp_base_080.php
/migrations/0.8.0/timestamp_name1.php
/migrations/0.8.1/
/migrations/0.8.1/timestamp_base_081.php
/migrations/0.8.1/timestamp_name2.php

The base files have empty up/down methods and are used to reset yourself between branch changes. find_migrations pulls a key pair array with the version id as the key and the files array as the value.

Having all files stored in a single folder can be cumbersome to manage over time. Is this a feature you'd be interested in adding to CI? I could send a PR for the current release if you feel it would be useful to others.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB