hi all started using migration , gr8 stuff but how can i maintain old data , or import it alongwith schema with same easiness, as in migration we only import schema ? thanks rohit --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060203/0e356e54/attachment.html
You can write all kinds of ruby code in a migration...So everything is actually possible... On 2/3/06, rohit mehra <rohitm2010@yahoo.com> wrote:> > hi all > started using migration , gr8 stuff > but how can i maintain old data , or import it alongwith schema with same > easiness, > as in migration we only import schema ? > thanks > rohit > > ------------------------------ > Yahoo! Mail<http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com>- Helps protect you from nasty viruses. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060203/865d221a/attachment.html
When using migration, you probably will be using Alter , add_columns etc to ur old table. That should not affect the data that are already there -- Rgds, --Siva Jagadeesan http://www.varcasa.com/ My First Rails Project. Education Through Collabration -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/0d08e657/attachment.html
rohit mehra <rohitm2010@...> writes:> > > hi all started using migration , gr8 stuff but how can i maintain old data, or import it alongwith schema with same easiness, as in migration we only import schema ? thanks rohit Well, I don''t pretend to stay database agnostic in my migrations so I use strictly execute() calls to run whatever sql I want. For example, you could create a temp table, copy the data into it, and copy it back. In postgres, temp tables are automatically dropped at the end of the transaction. As another said, you can also use whatever ruby code you what instead of using SQL.