Hi all, I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5 on Windows XP SP2 and Ruby 1.8.6 I have seven migrations. If I run them with an empty database, it runs the first three, then halts. When I look in schema_info, the version is 3. If I run db:migrate VERSION=7, then it runs through the remaining 4 migrations, and the version is 7 in the DB. Committed and everything. If I then run db:migrate on its own, then Rails will REVERT BACK those 4 migrations and set the version to 3 again. I don''t understand this behaviour. I''ve tried --trace and --verbose and neither explains why it is that Rails wants to roll back when the version is 7. I''ve only just recently arrived to Rails and Rake, so I''m not familiar with the internal structure, but I don''t see this behaviour mentioned in any of the documentation. Can anyone help? Will. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dejan Dimic
2007-Nov-12 08:00 UTC
Re: schema_info always wants to be 3, even when set to 7
It would be beneficial if you can send us the output that is presented to you while you do the db:migrate. Specially from migrating your db schema to an empty database. Dima On Nov 12, 8:20 am, Will Sargent <will.sarg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5 > on Windows XP SP2 and Ruby 1.8.6 > > I have seven migrations. If I run them with an empty database, it > runs the first three, then halts. When I look in schema_info, the > version is 3. > > If I run db:migrate VERSION=7, then it runs through the remaining 4 > migrations, and the version is 7 in the DB. Committed and everything. > > If I then run db:migrate on its own, then Rails will REVERT BACK those > 4 migrations and set the version to 3 again. > > I don''t understand this behaviour. I''ve tried --trace and --verbose > and neither explains why it is that Rails wants to roll back when the > version is 7. > > I''ve only just recently arrived to Rails and Rake, so I''m not familiar > with the internal structure, but I don''t see this behaviour mentioned > in any of the documentation. Can anyone help? > > Will.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Will Sargent
2007-Nov-12 09:18 UTC
Re: schema_info always wants to be 3, even when set to 7
On Nov 12, 12:00 am, Dejan Dimic <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It would be beneficial if you can send us the output that is presented > to you while you do the db:migrate. > Specially from migrating your db schema to an empty database.D:\home\wsargent\work\blog3>rake db:migrate (in D:/home/wsargent/work/blog3) == CreatePosts: migrating ====================================================-- create_table(:blog_post, {:id=>false}) -> 0.0790s -- execute("alter table blog_post add constraint blog_post_pk primary key (post_id)") -> 0.0620s == CreatePosts: migrated (0.1410s) =========================================== == CreateComments: migrating =================================================-- create_table(:blog_comment, {:primary_key=>"comment_id", :id=>false}) -> 0.0620s -- execute("alter table blog_comment add constraint blog_comment_pk primary key (comment_id)") -> 0.0470s -- execute("ALTER TABLE blog_comment\n ADD CONSTRAINT blog_comment_post_id_fk\n FOREIGN KEY (post_id)\n REFERENCES blog_post (post_id)\n ON DELETE CASCADE") -> 0.0310s == CreateComments: migrated (0.1400s) ======================================== == CreateUsers: migrating ====================================================-- create_table(:blog_user) -> 0.1410s == CreateUsers: migrated (0.1410s) =========================================== --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2007-Nov-12 13:09 UTC
Re: schema_info always wants to be 3, even when set to 7
You likely have an environment variable named VERSION that is set to 3 (or something that .to_i makes into 3). Since you''re on Windows, see what the output from: set shows to you. (Of course, the Unix equivalent is `env` for those playing along at home.) If you don''t need that variable for something else, try: unset VERSION or always specify the VERSION when you migrate: rake db:migrate VERSION=7 Please post back if this solves your problem. -Rob On Nov 12, 2007, at 4:18 AM, Will Sargent wrote:> > On Nov 12, 12:00 am, Dejan Dimic <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> It would be beneficial if you can send us the output that is >> presented >> to you while you do the db:migrate. >> Specially from migrating your db schema to an empty database. > > D:\home\wsargent\work\blog3>rake db:migrate > (in D:/home/wsargent/work/blog3) > == CreatePosts: migrating > ====================================================> -- create_table(:blog_post, {:id=>false}) > -> 0.0790s > -- execute("alter table blog_post add constraint blog_post_pk primary > key (post_id)") > -> 0.0620s > == CreatePosts: migrated (0.1410s) > ===========================================> > == CreateComments: migrating > =================================================> -- create_table(:blog_comment, > {:primary_key=>"comment_id", :id=>false}) > -> 0.0620s > -- execute("alter table blog_comment add constraint blog_comment_pk > primary key (comment_id)") > -> 0.0470s > -- execute("ALTER TABLE blog_comment\n ADD CONSTRAINT > blog_comment_post_id_fk\n FOREIGN KEY (post_id)\n > REFERENCES blog_post (post_id)\n ON DELETE CASCADE") > -> 0.0310s > == CreateComments: migrated (0.1400s) > ========================================> > == CreateUsers: migrating > ====================================================> -- create_table(:blog_user) > -> 0.1410s > == CreateUsers: migrated (0.1410s) > ===========================================>Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Will Sargent
2007-Nov-12 18:28 UTC
Re: schema_info always wants to be 3, even when set to 7
On Nov 12, 5:09 am, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:> You likely have an environment variable named VERSION that is set to 3 > (or something that .to_i makes into 3). > > Since you''re on Windows, see what the output from: > > set > > shows to you. (Of course, the Unix equivalent is `env` for those > playing along at home.)Thanks; that''s exactly what I would have never thought of. D:\home\wsargent\work\blog3>echo %VERSION% 3.5.0 Nasty. I wonder what software was responsible for installing that? Will. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dejan Dimic
2007-Nov-13 07:59 UTC
Re: schema_info always wants to be 3, even when set to 7
I always feel a great satisfaction when individual problems are solved by the community. Thanks you all out there one more time for your effort. Dima On Nov 12, 7:28 pm, Will Sargent <will.sarg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 12, 5:09 am, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> > wrote: > > > You likely have an environment variable named VERSION that is set to 3 > > (or something that .to_i makes into 3). > > > Since you''re on Windows, see what the output from: > > > set > > > shows to you. (Of course, the Unix equivalent is `env` for those > > playing along at home.) > > Thanks; that''s exactly what I would have never thought of. > > D:\home\wsargent\work\blog3>echo %VERSION% > 3.5.0 > > Nasty. I wonder what software was responsible for installing that? > > Will.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-13 14:19 UTC
Re: schema_info always wants to be 3, even when set to 7
Mr. Biedenharn, I am very grateful to observe your answer here and find the implications of viewing ones'' SET variables as instrumental to running on a Windows XP machine. Would you by chance know how to change these at the DOS command line? Thank you, Kathleen On Nov 12, 7:09 am, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:> You likely have an environment variable named VERSION that is set to 3 > (or something that .to_i makes into 3). > > Since you''re on Windows, see what the output from: > > set > > shows to you. (Of course, the Unix equivalent is `env` for those > playing along at home.) > > If you don''t need that variable for something else, try: > > unset VERSION > > or always specify the VERSION when you migrate: > > rake db:migrate VERSION=7 > > Please post back if this solves your problem. > > -Rob > > On Nov 12, 2007, at 4:18 AM, Will Sargent wrote: > > > > > > > > > On Nov 12, 12:00 am, Dejan Dimic <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> It would be beneficial if you can send us the output that is > >> presented > >> to you while you do the db:migrate. > >> Specially from migrating your db schema to an empty database. > > > D:\home\wsargent\work\blog3>rake db:migrate > > (in D:/home/wsargent/work/blog3) > > == CreatePosts: migrating > > ====================================================> > -- create_table(:blog_post, {:id=>false}) > > -> 0.0790s > > -- execute("alter table blog_post add constraint blog_post_pk primary > > key (post_id)") > > -> 0.0620s > > == CreatePosts: migrated (0.1410s) > > ===========================================> > > == CreateComments: migrating > > =================================================> > -- create_table(:blog_comment, > > {:primary_key=>"comment_id", :id=>false}) > > -> 0.0620s > > -- execute("alter table blog_comment add constraint blog_comment_pk > > primary key (comment_id)") > > -> 0.0470s > > -- execute("ALTER TABLE blog_comment\n ADD CONSTRAINT > > blog_comment_post_id_fk\n FOREIGN KEY (post_id)\n > > REFERENCES blog_post (post_id)\n ON DELETE CASCADE") > > -> 0.0310s > > == CreateComments: migrated (0.1400s) > > ========================================> > > == CreateUsers: migrating > > ====================================================> > -- create_table(:blog_user) > > -> 0.1410s > > == CreateUsers: migrated (0.1410s) > > ===========================================> > Rob Biedenharn http://agileconsultingllc.com > R...-xa9cJyRlE0mWcWVYNo9pw7VzRBSg3CFo@public.gmane.org Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2007-Nov-13 22:02 UTC
Re: schema_info always wants to be 3, even when set to 7
It''s been a while since I''ve had a Windows system around, but I believe either: unset VERSION or possibly: set VERSIONmight work. If you''re actually in Windows, not DOS, you can go to ControlPanel- >System->Environment and remove the setting of the VERSION variable. (The details of getting to that window are only approximate!) -Rob On Nov 13, 2007, at 9:19 AM, KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > Mr. Biedenharn, > I am very grateful to observe your answer here and find the > implications of viewing ones'' SET variables as instrumental to running > on a Windows XP machine. Would you by chance know how to change these > at the DOS command line? > Thank you, > Kathleen > > On Nov 12, 7:09 am, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> > wrote: >> You likely have an environment variable named VERSION that is set >> to 3 >> (or something that .to_i makes into 3). >> >> Since you''re on Windows, see what the output from: >> >> set >> >> shows to you. (Of course, the Unix equivalent is `env` for those >> playing along at home.) >> >> If you don''t need that variable for something else, try: >> >> unset VERSION >> >> or always specify the VERSION when you migrate: >> >> rake db:migrate VERSION=7 >> >> Please post back if this solves your problem. >> >> -Rob >> >> On Nov 12, 2007, at 4:18 AM, Will Sargent wrote: >> >> >> >> >> >> >> >>> On Nov 12, 12:00 am, Dejan Dimic <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> It would be beneficial if you can send us the output that is >>>> presented >>>> to you while you do the db:migrate. >>>> Specially from migrating your db schema to an empty database. >> >>> D:\home\wsargent\work\blog3>rake db:migrate >>> (in D:/home/wsargent/work/blog3) >>> == CreatePosts: migrating >>> ====================================================>>> -- create_table(:blog_post, {:id=>false}) >>> -> 0.0790s >>> -- execute("alter table blog_post add constraint blog_post_pk >>> primary >>> key (post_id)") >>> -> 0.0620s >>> == CreatePosts: migrated (0.1410s) >>> ===========================================>> >>> == CreateComments: migrating >>> =================================================>>> -- create_table(:blog_comment, >>> {:primary_key=>"comment_id", :id=>false}) >>> -> 0.0620s >>> -- execute("alter table blog_comment add constraint blog_comment_pk >>> primary key (comment_id)") >>> -> 0.0470s >>> -- execute("ALTER TABLE blog_comment\n ADD CONSTRAINT >>> blog_comment_post_id_fk\n FOREIGN KEY (post_id)\n >>> REFERENCES blog_post (post_id)\n ON DELETE CASCADE") >>> -> 0.0310s >>> == CreateComments: migrated (0.1400s) >>> ========================================>> >>> == CreateUsers: migrating >>> ====================================================>>> -- create_table(:blog_user) >>> -> 0.1410s >>> == CreateUsers: migrated (0.1410s) >>> ===========================================>> >> Rob Biedenharn http://agileconsultingllc.com >> R...-xa9cJyRlE0mWcWVYNo9pw7VzRBSg3CFo@public.gmane.org Hide quoted text - >> >> - Show quoted text - > > > >Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org +1 513-295-4739 Skype: rob.biedenharn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---