Disable Migration creation in generate Model


#1

Hi…

Is there some way to configure Rails to not create a
db/migrate/###_model_name.rb when I do a script/generate model
ModelName?

It’s a little annoying when I’m setting up a new application since I
prefer creating all the first tables in a 001_inital_schema.rb file.
Then when I generate models for those tables I get migration scripts
for all of them again that I have to delete. And it’s a bit annoying
especially since I use the --svn flag so the unneeded migration go
also into the subversion repo. I’m hoping that there is some way to
disable this without editing the generate script itself.

Personally I feel this shouldn’t to this by default since the
script/generate migration command is much more to the point.


#2

Jón Borgþórsson wrote:

Hi…

Is there some way to configure Rails to not create a
db/migrate/###_model_name.rb when I do a script/generate model
ModelName?

I believe that script/generate model ModelName --skip-migration will do
what you want. Incidentally, you can find out the available options by
doing script/generate, or more specifically script/generate
<thing_to_generate>

It will output a help screen.

John


#3

Damn… I had actually checked that out before and simply didn’t
notice it. Even though I was looking for it. :slight_smile:

On 6/3/06, John T. removed_email_address@domain.invalid wrote:

<thing_to_generate>
http://lists.rubyonrails.org/mailman/listinfo/rails


#4

Thanks, John,

I was wondering about that too.
-Larry