saasbook

initial_migration.rb

Mar 13th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.41 KB | None | 0 0
  1. class CreateMovies < ActiveRecord::Migration
  2.   def up
  3.     create_table 'movies' do |t|
  4.       t.string 'title'
  5.       t.string 'rating'
  6.       t.text 'description'
  7.       t.datetime 'release_date'
  8.       # Add fields that let Rails automatically keep track
  9.       # of when movies are added or modified:
  10.       t.timestamps
  11.     end
  12.   end
  13.  
  14.   def down
  15.     drop_table 'movies' # deletes the whole table and all its data!
  16.   end
  17. end
Add Comment
Please, Sign In to add comment