Hi: I''m running RoR 1.1 I''m going through the Agile book Depot example and I want to generate my next migration file so i''m typing ./script/generate migration depot I was sort of expecting to get the file 002_depot.rb .. instead i''m being informed that there already exists a migration named depot..and no new file is generated.. should I be using a new name? I tried that accidentally and got 002_help.rb ? -- Posted via http://www.ruby-forum.com/.
The agile book came out while migrations were a work in progress, so it doesn''t really cover this. If you look at the file you create you will notice that the migration creates a class with a name the same as you gave in the migration: class Products < ActiveRecord::Migration ... end this is without the 001_ or 002_, so you would have a clas name conflict if you use the same name twice. Here is a link to some docs: http://api.rubyonrails.com/classes/ActiveRecord/Migration.html -Sean Andrew wrote:> Hi: > > I''m running RoR 1.1 > > I''m going through the Agile book Depot example and I want to generate my > next migration file so i''m typing > > ./script/generate migration depot > > I was sort of expecting to get the file 002_depot.rb .. instead i''m > being informed that there already exists a migration named depot..and no > new file is generated.. > > should I be using a new name? I tried that accidentally and got > 002_help.rb > > ?-- Posted via http://www.ruby-forum.com/.
Different name definitely. To get help, just leave out the final arg: ./script/generate migration Did you know that if you generate model Foo that it will create the migration for create_foos automatically? -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739 On Mar 30, 2006, at 12:13 PM, Andrew wrote:> Hi: > > I''m running RoR 1.1 > > I''m going through the Agile book Depot example and I want to > generate my > next migration file so i''m typing > > ./script/generate migration depot > > I was sort of expecting to get the file 002_depot.rb .. instead i''m > being informed that there already exists a migration named > depot..and no > new file is generated.. > > should I be using a new name? I tried that accidentally and got > 002_help.rb > > ? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Maybe Matching Threads
- Demo in rails2.pdf of add_price migration, PostgreSQL 8.1.4
- Agile book apache2.conf: Forbidden You don't have permission to access / on this server.
- Why doesn''t Rails 1.1 have all the Script.aculo.us 1.6 files?
- Possible Problem with RSpec and
- New to rails