Migrations questions #1031

rdelpeso opened this Issue Feb 12, 2012 · 1 comment

2 participants


Hi, I was starting to move from my current form of migrations to using CI's implementation. But i found that currently there are a couple of things that prevent me from doing so.

1 There is no way to obtain the current migration from a controller/model/library

The visibility of the function _get_version() is protected. Other than building a query for every application that is. I use this to implement features in my applications and deploy them at a later date. Say I add a news banner that requires a DB table to store the headings. I'd like to be able to ensure that if the database has not been migrated (current version is lower than target version) the feature is invisible to the end user even if the code has been updated to the latest revision.

2 Extending the Migrations library requires me to duplicate the constructor

For some reason, there is a bit of code that prevents re-using the constructor of the migrations class.

# Only run this constructor on main library load
if (get_parent_class($this) !== FALSE)

I don't follow the logic here. I could not find any comments/notes/posts regarding this.

Edit: #799 seems to have touched on this and made it clear why the clause is there. I agree with akeemphilbert in the fact that it should allow the constructor to run for either itself, or $custom_prefix."_Migration"

I can do the changes i require locally, but then that will make it harder to use a new version of CI when it comes out (I would have to apply my local patches every time). I'd be glad to contribute the changes i believe will be beneficial to everyone but i thought of asking first in case I am missing something.

Let me know what you think, thanks


Like I said over there "Seems pretty edge case. Just check the config."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment