Rails better way to have migration

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

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?

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

Email : [email protected]

On Fri, Nov 14, 2014 at 2:34 PM, Walther D.
[email protected]

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

:slight_smile:

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…

Thanks in advance…

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan

Email : [email protected]

On Fri, Nov 14, 2014 at 2:49 PM, Walther D.
[email protected]

On 14 November 2014 09:23, M,Gopi M.gopinath [email protected]
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

Hi Colin,

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…

Thanks in advance…

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan

Email : [email protected]

Yes, I need some good reason to explain.

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan

Email : [email protected]

On 14 November 2014 08:27, M,Gopi M.gopinath [email protected]
wrote:

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

The way I see it - your next guy needs to explain why he would like to
add to the work load!

He actually think about lot of files :frowning:

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan

Email : [email protected]

On Fri, Nov 14, 2014 at 3:00 PM, Walther D.
[email protected]

On 14 November 2014 09:40, M,Gopi M.gopinath [email protected]
wrote:

He actually think about lot of files :frowning:

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

On Fri, Nov 14, 2014 at 3:47 PM, Colin L. [email protected] wrote:

thanks.

Colin


​Thanks Colin.

Gopinath​

On Fri, Nov 14, 2014 at 1:40 AM, M,Gopi M.gopinath
[email protected] wrote:

He actually think about lot of files :frowning:

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 :slight_smile:

Good luck,

Hassan S. ------------------------ [email protected]

twitter: @hassan

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.

On 15 November 2014 02:48, Hassan S. [email protected]