Forum: Rails Engines a bug with script/generate plugin_migrations ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A734a55f2acf2b4d230ca73e16881b7a?d=identicon&s=25 Trevor Rowe (Guest)
on 2007-04-26 19:35
(Received via mailing list)
I tried searching the mailing list for an answer with no luck.  I'm
hoping this is just user error:



I recently upgraded my rails app to Rails 1.2.3 (from Rails 1.1.6) and
upgraded to engines 1.2 at the same time.  I ran script/generate
plugin_migrations for the first time and it created an application
migration would run my plugin migration from 0-45 (as expected).



I added a new migration to my plugin, ran the script/generate
plugin_migration again and it added a second application migration, but
in the down method it migrates to version 0 instead of version 45 as I
would have expected.  Any ideas on what I could be doing wrong?  I
checked the db and the plugins_schema_info table has my plugin currently
at version 45 and my application at 1.  Any suggestions would be
helpful.



Trevor Rowe
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2007-04-27 10:40
(Received via mailing list)
Hi Trevor,The most common reason for this would be that you
plugin_schema_info version for the plugin was still 0 when you ran
script/generate plugin_migration for the second time. Can you confirm
that you did run rake db:migrate between generating the first plugin
migration and the second?
A734a55f2acf2b4d230ca73e16881b7a?d=identicon&s=25 Trevor Rowe (Guest)
on 2007-04-27 17:36
(Received via mailing list)
I did some more digging.  I had run the migration already for my local
development environment, but curiously enough I went to test this again
today and here is what I noticed:

I built a new plugin migration and tried to run script/generate
plugin_migration and I got an error that said I couldn't connect to the
db.  My development db is on localhost, and I realized then it was
connecting to the production db to get information on what migration it
should run.

Is there a way to set the environment?

I tried adding the environment as -e, --environment, RAILS_ENV=, just
adding the environment name, etc, no luck.  This would explain my
previous problem, the migration had been run, just not against my
production environment yet.

Any suggestions?

Trevor
This topic is locked and can not be replied to.