j4mie / paris

A lightweight Active Record implementation for PHP5, built on top of Idiorm.
http://j4mie.github.com/idiormandparis/
996 stars 131 forks source link

Migration support (schema/table from model code) #16

Closed noodlehaus closed 11 years ago

noodlehaus commented 13 years ago

I'm wondering if migrations will eventually be added to Paris/Idiorm? It would really be nice if we could be saved from having to create schema files and just design everything through our models. Thanks.

treffynnon commented 11 years ago

This is an unlikely feature. The simplicity of Paris and Idiorm is in that they can work with any database with very minimal configuration. Managing the schema is outside the scope of these projects. It could make for a nice separate utility. There is a project like this already in existence by @davedevelopment : https://github.com/davedevelopment/phpmig which might help with this but I have not tried it out.

lalop commented 11 years ago

Hello, I made an pdo adapter to phpmig like that you can use it with idiorm to manage migration


$container['db'] = $container->share(function(){
    return ORM::get_db();
});
$container['phpmig.adapter'] = $container->share(function() use($container) {
     return new Adapter\PDO\Sql($container['db'],'migrations');
});
treffynnon commented 11 years ago

This looks like good work - I have yet to try it out. I will likely add this compatibility to the documentation to make it clearer for people looking for migrations in tandem with Paris.

treffynnon commented 11 years ago

Closed in commit 85729be

lalop commented 11 years ago

Which commit ?

treffynnon commented 11 years ago

@lalop I am working on it. Haven't pushed just yet!

lalop commented 11 years ago

ok sorry :)

2013/1/25 Simon Holywell notifications@github.com

@lalop https://github.com/lalop I am working on it. Haven't pushed just yet!

— Reply to this email directly or view it on GitHubhttps://github.com/j4mie/paris/issues/16#issuecomment-12696240.