Fahim Patel
2012-Sep-21 11:19 UTC
how to get effects from test database to development database
Hi all As we all know that rake db:test:prepare effects all the changes from development database to test database. But due to one mistake i wish to make development database same as my test database. So how can i get effects from test database to development database ? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_eB1ncYsJckJ. For more options, visit https://groups.google.com/groups/opt_out.
Fahim Patel
2012-Sep-22 04:18 UTC
Re: how to get effects from test database to development database
any one know this topic On Friday, September 21, 2012 4:49:58 PM UTC+5:30, Fahim Patel wrote:> > Hi all > > As we all know that rake db:test:prepare effects all the changes from > development database to test database. > But due to one mistake i wish to make development database same as my test > database. > > So how can i get effects from test database to development database ? > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/bzXbFsjA1UoJ. For more options, visit https://groups.google.com/groups/opt_out.
Peter Hickman
2012-Sep-22 07:53 UTC
Re: Re: how to get effects from test database to development database
To be honest you should fix your development database to be how it should be. If it is correct and the test database does not match then the test database is in error. You are getting no response to your query because no one in their right mind would do what you want to do and so there is no advice to give you. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Fahim Patel
2012-Sep-22 08:31 UTC
Re: how to get effects from test database to development database
I just want to make my development database same as test database . Is there any command to make this possible? As i know rake db:test:prepare command update test database as development database. But i wish to do opposite ? Hope u understand the question On Friday, September 21, 2012 4:49:58 PM UTC+5:30, Fahim Patel wrote:> > Hi all > > As we all know that rake db:test:prepare effects all the changes from > development database to test database. > But due to one mistake i wish to make development database same as my test > database. > > So how can i get effects from test database to development database ? > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/bIAxHYJ7-0wJ. For more options, visit https://groups.google.com/groups/opt_out.
Peter Hickman
2012-Sep-22 09:39 UTC
Re: Re: how to get effects from test database to development database
There is no command to migrate the structure of the test database to the development database. There is no need for such a command. Just create migrations for the development database that set it up correctly in the first place. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Fahim Patel
2012-Sep-22 10:06 UTC
Re: how to get effects from test database to development database
Actually i have raise same question yesterday, but no buddy response . Today i raise new topic and u response.. I will explain now I am using has_and_belong_to_many association . This association will create third table automatically as per my knowledge, and by chance i have deleted that table from mysql. Now i wish to get that table but as i know there is no migration file is created when we use this type of Association. And i dont want to create migration because than i am not following the rails rules. And if i create migration than what is use of has_and_belongs_to_many association. Refer my Yesterday question for better explaintion... Hope u will understood now. I have two models cow and milkman. I am using has_and_belongs_to_many in both models . By mistake i have deleted cows_milkmans table from database. When i use this command i am getting error a = Cow.last a.milkmans # when i fire this command then i am getting error that cows_milkmans table not exist As per my knowledge has_and_belongs_to_many will create third table automatically , no migration is needed. How can get that table ? On Friday, September 21, 2012 4:49:58 PM UTC+5:30, Fahim Patel wrote:> > Hi all > > As we all know that rake db:test:prepare effects all the changes from > development database to test database. > But due to one mistake i wish to make development database same as my test > database. > > So how can i get effects from test database to development database ? > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_EK15DE3gEAJ. For more options, visit https://groups.google.com/groups/opt_out.
Fabian Becker
2012-Sep-22 10:12 UTC
Re: Re: how to get effects from test database to development database
For a has_and_belongs_to_many association there has to be a migration (but there is no model!). Rails does not automatically create tables for you. If you are still in development, just drop your database and migrate again: rake db:migrate:reset On Sat, Sep 22, 2012 at 12:06 PM, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Actually i have raise same question yesterday, but no buddy response . > Today i raise new topic and u response.. > I will explain now > I am using has_and_belong_to_many association . This association will > create third table automatically as per my > knowledge, and by chance i have deleted that table from mysql. > Now i wish to get that table but as i know there is no migration file is > created when we use this type of Association. > And i dont want to create migration because than i am not following the > rails rules. > And if i create migration than what is use of has_and_belongs_**to_many > association. > > Refer my Yesterday question for better explaintion... > Hope u will understood now. > > > I have two models cow and milkman. > I am using has_and_belongs_to_many in both models . > By mistake i have deleted cows_milkmans table from database. > > When i use this command i am getting error > a = Cow.last > a.milkmans # when i fire this command then i am getting error that > cows_milkmans table not exist > > As per my knowledge has_and_belongs_**to_many will create third table > automatically , no migration is needed. > > How can get that table ? > > On Friday, September 21, 2012 4:49:58 PM UTC+5:30, Fahim Patel wrote: >> >> Hi all >> >> As we all know that rake db:test:prepare effects all the changes from >> development database to test database. >> But due to one mistake i wish to make development database same as my >> test database. >> >> So how can i get effects from test database to development database ? >> >> >> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/_EK15DE3gEAJ. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Fahim Patel
2012-Sep-22 10:28 UTC
Re: how to get effects from test database to development database
Now i am surprise, because i just write has_and_belongs_to_many in my models. And i go to console and i fire the command and i get nil. At this moment my third table created automaticlly, no migration file is present is there. rake db:migrate:reset # what this command will do ? On Friday, September 21, 2012 4:49:58 PM UTC+5:30, Fahim Patel wrote:> > Hi all > > As we all know that rake db:test:prepare effects all the changes from > development database to test database. > But due to one mistake i wish to make development database same as my test > database. > > So how can i get effects from test database to development database ? > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/IGQjE4ia5vwJ. For more options, visit https://groups.google.com/groups/opt_out.
Norbert Melzer
2012-Sep-24 17:34 UTC
Re: Re: how to get effects from test database to development database
2012/9/22 Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> rake db:migrate:reset # what this command will do ?What would you guess? What says ´rake -T´? What is google telling you? OK, last but not least: It does what it says… It is resetting the database of your current environment by dropping all tables and running all migrations beginning with the first one ever created. HTH Norbert -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.