Migrations In3 Mins

768 views
700 views

Published on

The slides from a very short presentation I did at the Melbourne Ruby User Group's Nuby Night.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
768
On SlideShare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Migrations In3 Mins

  1. 1. Migrations
  2. 2. Why Migrations?
  3. 3. Agility
  4. 4. Agility Incrementally improve your schema
  5. 5. $ script/generate migration create_bids
  6. 6. $ script/generate migration create_bids $RAILS_ROOT/db/migrate/001_create_bids.rb
  7. 7. $ rake db:migrate
  8. 8. $ rake db:migrate $ rake db:migrate VERSION=0
  9. 9. Transformations create_table(name, options) drop_table(name) add_column(table_name, column_name, type, options) remove_column(table_name, column_name)
  10. 10. More... rename_table(old_name, new_name) rename_column(table_name, column_name, new_column_name) change_column(table_name, column_name, type, options)
  11. 11. And then some. add_index(table_name, column_names, index_type, index_name) remove_index(table_name, index_name)
  12. 12. I'm Abhi from Cogent Consulting. Thank You.
  13. 13. $RAILS_ROOT/db/migrate/001_create_bids.rb $ rake db:migrate VERSION=N

×