Re: [Rails] Rails better way to have migration

75 views
Skip to first unread message

Walther Diechmann

unread,
Nov 14, 2014, 4:11:17 AM11/14/14
to rubyonra...@googlegroups.com
as long as you develop - one file per migration

once you ‘wrap’ it up - a single file is ok

but why change it in the first place?

Den 14/11/2014 kl. 09.27 skrev M,Gopi M.gopinath <gopi1...@gmail.com>:

Hi All,

I have question with rails migration file.

Seems In rails for each and every table migration file will be generate with timestamp followed by table name.

But I have moved all the migration file to a single file, and deleted all the migrations.

what is the best way of practice, 

Having single migration for each table or else a single migration file for the whole application.

Thanks in advance...



Best Regards,

Gopinath M

Ruby on Rails Developer






--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPDEixJMJsZNEjCuCFw%3DRkkq2kGvJnmCGEnucCF3H-XNMBs5uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Walther Diechmann

unread,
Nov 14, 2014, 4:20:49 AM11/14/14
to rubyonra...@googlegroups.com
best practise is to leave it alone -

rails generate scaffold some_class some_field_name some_other_field_name ……
rails db:migrate

that’s it

:)


Den 14/11/2014 kl. 10.16 skrev M,Gopi M.gopinath <gopi1...@gmail.com>:

I may be adding few things later to database table, But Know I am in initial stage has only 10 table .... 

What is the Best practices?



Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan







For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Message has been deleted

Colin Law

unread,
Nov 14, 2014, 4:25:59 AM11/14/14
to rubyonra...@googlegroups.com
On 14 November 2014 08:27, M,Gopi M.gopinath <gopi1...@gmail.com> wrote:
> Hi All,
>
> I have question with rails migration file.
>
> Seems In rails for each and every table migration file will be generate with
> timestamp followed by table name.
>
> But I have moved all the migration file to a single file, and deleted all
> the migrations.
>
> what is the best way of practice,
>
> Having single migration for each table or else a single migration file for
> the whole application.

The best practice with rails is almost always to do it the way rails
wants you to. So one file per migration. What is the point of doing
the extra work of combining them into one file?

Colin

Colin Law

unread,
Nov 14, 2014, 4:27:15 AM11/14/14
to rubyonra...@googlegroups.com
On 14 November 2014 09:23, M,Gopi M.gopinath <gopi1...@gmail.com> wrote:
> But my team meet preferring to keep it as a single file.
>
> Some argument where going between us, I can't able to convenience him to
> keep separate for all tables. Can I provide any links or url to get clear
> understanding for him..

Why does he want to do that? What is the point of doing extra work?
Do you not have enough work without doing extra work?

Are any more good reasons required?

Colin

Walther Diechmann

unread,
Nov 14, 2014, 4:31:44 AM11/14/14
to rubyonra...@googlegroups.com
The way I see it - your next guy needs to explain why he would like to add to the work load!



Den 14/11/2014 kl. 10.28 skrev M,Gopi M.gopinath <gopi1...@gmail.com>:

Yes, I need some good reason to explain.

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan






--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Nov 14, 2014, 5:18:38 AM11/14/14
to rubyonra...@googlegroups.com
On 14 November 2014 09:40, M,Gopi M.gopinath <gopi1...@gmail.com> wrote:
> He actually think about lot of files :(

Ask him which is most important, a few extra files (which makes no
difference to the operation of the site) or you spending extra time
rationalising them. If he prefers you to waste your time and he is
the boss then you must do as he says.

By the way please don't top post, it makes it difficult to follow the
thread. Insert your reply at appropriate points in previous message,
thanks.

Colin

Hassan Schroeder

unread,
Nov 14, 2014, 10:49:27 AM11/14/14
to rubyonrails-talk
On Fri, Nov 14, 2014 at 1:40 AM, M,Gopi M.gopinath <gopi1...@gmail.com> wrote:
> He actually think about lot of files :(

Then "he" apparently has too much time on his hands.

Aside from the good points already made, retaining the individual
migrations offers useful "tree-ring" documentation of the evolution
of the app over time.

Meanwhile, tell "him" to worry about actually important things, like
whether your app has 100% test coverage :-)

Good luck,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Timothy Mukaibo

unread,
Nov 15, 2014, 12:33:31 AM11/15/14
to rubyonra...@googlegroups.com
It sounds like "he" is unaware of schema.db! This is the consolidated schema of all the migrations which have run - the single view of the world that your colleague is asking for.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages