Sha256: 7df65e581936e4b7db20da5a044abf47947e706172e6482dc61bc9edd792ba30

Contents?: true

Size: 1.15 KB

Versions: 80

Compression:

Stored size: 1.15 KB

Contents

Description:
    Stubs out a new database migration. Pass the migration name, either
    CamelCased or under_scored, and an optional list of attribute pairs as arguments.

    A migration class is generated in db/migrate prefixed by a timestamp of the current date and time.

    You can name your migration in either of these formats to generate add/remove
    column lines from supplied attributes: AddColumnsToTable or RemoveColumnsFromTable

Example:
    `./script/generate migration AddSslFlag`

    If the current date is May 14, 2008 and the current time 09:09:12, this creates the AddSslFlag migration
    db/migrate/20080514090912_add_ssl_flag.rb

    `./script/generate migration AddTitleBodyToPost title:string body:text published:boolean`
    
    This will create the AddTitleBodyToPost in db/migrate/20080514090912_add_title_body_to_post.rb with
    this in the Up migration:

      add_column :posts, :title, :string  
      add_column :posts, :body, :text  
      add_column :posts, :published, :boolean

    And this in the Down migration:
    
      remove_column :posts, :published  
      remove_column :posts, :body  
      remove_column :posts, :title

Version data entries

80 entries across 80 versions & 15 rubygems

Version Path
toastyapps-migratory-0.0.10 generators/migration/USAGE
toastyapps-migratory-0.0.6 generators/migration/USAGE
toastyapps-migratory-0.0.7 generators/migration/USAGE
toastyapps-migratory-0.0.8 generators/migration/USAGE
toastyapps-migratory-0.0.9 generators/migration/USAGE
rails-2.3.18 lib/rails_generator/generators/components/migration/USAGE
rails_csi-2.3.5.p8 lib/rails_generator/generators/components/migration/USAGE
rails-2.3.17 lib/rails_generator/generators/components/migration/USAGE
rails_csi-2.3.5.p7 lib/rails_generator/generators/components/migration/USAGE
rails_csi-2.3.5.p6 lib/rails_generator/generators/components/migration/USAGE
rails-2.3.16 lib/rails_generator/generators/components/migration/USAGE
rails-2.3.15 lib/rails_generator/generators/components/migration/USAGE
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rails-2.3.14/lib/rails_generator/generators/components/migration/USAGE
vanity-1.7.1 vendor/ruby/1.9.1/gems/rails-2.3.12/lib/rails_generator/generators/components/migration/USAGE
rails-2.3.14 lib/rails_generator/generators/components/migration/USAGE
kajam-1.0.3.rc2 vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE
rails-2.3.12 lib/rails_generator/generators/components/migration/USAGE
radiant-1.0.0.rc2 vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE
radiant-1.0.0.rc1 vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE
webroar-0.5.0 src/admin_panel/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE