aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
Commit message (Collapse)AuthorAgeFilesLines
* Set active_record config for always creating uuids in generatorsJon McCartie2015-10-201-1/+1
|
* Add Secure Token Generatorrobertomiranda2015-01-111-0/+5
|
* Change the default `null` value for `timestamps` to `false`Rafael Mendonça França2015-01-041-1/+1
|
* Use the new `foreign_key` option on `references` in generatorsSean Griffin2014-12-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes `rails g model Post user:references` from def change create_table :posts do |t| t.references :user, index: true end add_foreign_key :posts, :users end to def change create_table :posts do |t| t.references :user, index: true, foreign_key: true end end Changes `rails g migration add_user_to_posts user:references` from def change add_reference :posts, :users, index: true add_foreign_key :posts, :users end to def change add_reference :posts, :users, index: true, foreign_key: true end
* Generators add foreign keys on referencesDerek Prior2014-11-251-0/+3
| | | | | | | | | | | If you run a generator such as: ``` rails generate model accounts supplier:references ``` The resulting migration will now add the corresponding foreign key constraint unless the reference was specified to be polymorphic.
* Change the default `null` value for timestampsSean Griffin2014-08-121-1/+1
| | | | | | | As per discussion, this changes the model generators to specify `null: false` for timestamp columns. A warning is now emitted if `timestamps` is called without a `null` option specified, so we can safely change the behavior when no option is specified in Rails 5.
* Add support for generate scaffold password:digestSam Ruby2013-03-131-0/+4
| | | | | | | | | | * adds password_digest attribute to the migration * adds has_secure_password to the model * adds password and password_confirmation password_fields to _form.html * omits password entirely from index.html and show.html * adds password and password_confirmation to the controller * adds unencrypted password and password_confirmation to the controller test * adds encrypted password_digest to the fixture
* Support creating a table migration generatorSammy Larbi2013-03-011-0/+15
Sometimes you want to create a table without an associated model and test, which is also not a join table. With this commit, you can now do that. Example: rails g migration create_posts title:string or rails g migration CreatePosts title:string This commit also moves the template the model generator uses for the migration to the migration templates folder, as it seems a more sensible place for it now that it is shared code.