Forum: Ruby on Rails Disable Migration creation in generate Model

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
30ee518e6fdc5b07e060775b5a542bdb?d=identicon&s=25 Jón Borgþórsson (jongretar)
on 2006-06-03 14:01
(Received via mailing list)
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.

--
3b687a35025c05dbc7627af428dff0da?d=identicon&s=25 John Topley (Guest)
on 2006-06-03 14:23
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
30ee518e6fdc5b07e060775b5a542bdb?d=identicon&s=25 Jón Borgþórsson (jongretar)
on 2006-06-03 15:11
(Received via mailing list)
Damn... I had actually checked that out before and simply didn't
notice it. Even though I was looking for it. :)


On 6/3/06, John Topley <john@johntopley.com> wrote:
> <thing_to_generate>
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
29b15f133c26b6dac0e4954d61733db9?d=identicon&s=25 Larry Kelly (Guest)
on 2006-06-03 16:54
(Received via mailing list)
Thanks, John,

I was wondering about that too.
-Larry
This topic is locked and can not be replied to.