Welcome Guest, Not a member yet? Register   Sign In
ErkanaMigrate: Rails-style Migrations Powered by CI 1.6's DBForge
#1

[eluser]Michael Wales[/eluser]
Pre-super-duper Alpha

If you use this in a live project that someone is paying you for I can almost guarantee I will piss myself laughing when it all dies.

This is more a proof of concept and an initial release to get people's opinions on how I attacked the problem of Database versioning.

Most all of the details can be found on my blog: Database Migrations for CodeIgniter 1.6.1, but I'll run through the basics here.

ErkanaMigrate utilizes a table on your database to store current version information (the table name is easily editable and will be automagically created if it doesn't exist). In addition, you will create migration files (once again, location is editable and the directory will be automagically created if possible).

ErkanaMigrate really only features two methods you are worried about: up() and down(). Currently these only go one step in either direction but this will be rectified in future versions. Just call one of these methods from a Controller and watch the magic begin. I highly recommend your protect this controller somehow or you may have a hell of a lot of magic to contend with.

There are also some "entry methods" within the library that make it a bit easier to interface with the DBForge library from your migration files. These don't add a ton of functionality (yet) but due cut down quite a bit on typing.

So, if you are interested in database version control - or simply coding out your database tables in PHP and managing them in a logical manner, please feel free to check out ErkanaMigrate.

I will be actively developing this library and much more involved in its development than ErkanaAuth - so suggestions are highly encouraged.
#2

[eluser]John Fuller[/eluser]
Quote:If you use this in a live project that someone is paying you for I can almost guarantee I will piss myself laughing when it all dies.

Why would anyone use migrations for anything other than development? I haven't played with Rails much but I thought migrations were just a quick way to make changes to the database and (like scaffolding) would never be used in a production environment.

This is really cool though. Thanks for giving this a shot. I will likely be doing something like this for my projects as well so this will probably help get me jump started.

Edit: I probably just need to spend more time playing with Rails to see how the migrations work. I am not questioning you, just trying to better understand migrations.
#3

[eluser]sikkle[/eluser]
Michael wales, i'll give it a look, cool little extention really.

see ya around.
#4

[eluser]John Fuller[/eluser]
Ah, disregard my last post. I locked myself in the can for a couple hours and did some readin' up migrations. I see they are used for helping in managing production databases as well. I assumed migrations were like scaffolding, only used in the development process.

That got me looking around for some PHP YAML libraries and I came across Spyc. Looks like fun times.
#5

[eluser]Michael Wales[/eluser]
Quote:Why would anyone use migrations for anything other than development?

I wasn't referring to migrations in general, I was referring to this library. Personally, I am using it for the development of a client project; but, if you do so - do so at your own risk. There's no error checking at the moment and you could potentially ruin your life with it.

Migrations in general - of course you would use them for development in addition to version control.




Theme © iAndrew 2016 - Forum software by © MyBB