Database in Rails - mnishiguchi/authentication_demo GitHub Wiki
Database in Rails
http://edgeguides.rubyonrails.org/active_record_migrations.html#rolling-back
Database level validation
- Active Record Migrations
- Database level validation - Be The Better Rails Developer
- Default and Not Null clauses
- Column indexing
- Unique column constraints
- Foreign keys
- Update statements
- Multiple inserts/updates
- Available field types
Rolling Back
rake db:rollback
- Executes the drop_table command to remove the users table from the database.
- Works only for reversible migrations by default.
- In the case of an irreversible migration, such as one to remove a database column, it is necessary to define separate up and down methods in place of the single change method: