Updating rails 2.3 plugins database

26 views
Skip to first unread message

Vanuan

unread,
May 2, 2012, 2:18:29 PM5/2/12
to rubyonra...@googlegroups.com
As I discovered on github https://github.com/rails/rails/issues/5424
rails engines migrations should be checked into source control.
But I don't see how it's possible to upgrade database with rails 2.3 plugins migrations to rails 3 engines migrations. (duplicate table and column names, etc.)
Do you have any thoughts?

Piotr Sarnacki

unread,
May 2, 2012, 10:59:56 PM5/2/12
to rubyonra...@googlegroups.com
Please specify which plugin have you used for engines migrations in 2.3 or describe your situation better - how does your migration files look like?

Vanuan

unread,
May 3, 2012, 9:48:48 AM5/3/12
to rubyonra...@googlegroups.com
I use this plugin
https://github.com/lazyatom/engines
which I think is now integrated into Rails 3. Or is it?

My migration files are in vendor/plugins/my_plugins/db/migrate/0xx_migration_name.rb
When I run install migrations task, they are copied to db/migrate/2100000xx_migration_name.rb
And when I run db:migrate I end up with migration errors

Piotr Sarnacki

unread,
May 3, 2012, 1:34:44 PM5/3/12
to rubyonra...@googlegroups.com
On Thu, May 3, 2012 at 6:48 AM, Vanuan <van...@gmail.com> wrote:
I use this plugin
https://github.com/lazyatom/engines
which I think is now integrated into Rails 3. Or is it?

When we were working on engines we were taking a look at existing solutions, but we didn't aim at porting any existing plugins 1 to 1. There were also other approaches.
 

My migration files are in vendor/plugins/my_plugins/db/migrate/0xx_migration_name.rb
When I run install migrations task, they are copied to db/migrate/2100000xx_migration_name.rb
And when I run db:migrate I end up with migration errors

What you could do is to copy those migrations by hand without changing timestamps. Rewriting timestamps is important only if you need to depend on previous migrations and since you were not using such mechanisms, you should be fine with that. After copying migrations to your app they should be skipped on next migrations:install task.
 

On Thursday, 3 May 2012 05:59:56 UTC+3, Piotr Sarnacki wrote:
Please specify which plugin have you used for engines migrations in 2.3 or describe your situation better - how does your migration files look like?

On Wednesday, May 2, 2012 11:18:29 AM UTC-7, Vanuan wrote:
As I discovered on github https://github.com/rails/rails/issues/5424
rails engines migrations should be checked into source control.
But I don't see how it's possible to upgrade database with rails 2.3 plugins migrations to rails 3 engines migrations. (duplicate table and column names, etc.)
Do you have any thoughts?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/3q7n1WEZSzcJ.

To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.



--
Piotr Sarnacki
http://piotrsarnacki.com
Reply all
Reply to author
Forward
0 new messages