Skip to content

Instantly share code, notes, and snippets.

@chriscooning
Created March 19, 2014 18:26
Show Gist options
  • Save chriscooning/9648103 to your computer and use it in GitHub Desktop.
Save chriscooning/9648103 to your computer and use it in GitHub Desktop.
migration modify
class CreateSurveys < ActiveRecord::Migration
def change
create_table :surveys do |t|
t.integer :author_id, null: false
t.text :customer_name, null: false
t.string :phone, null: true
t.text :address, null: true
t.string :zipcode, null: true
t.string :city, null: true
t.string :state, null: true, limit: 2
t.text :summary, null: false
t.integer :last_interaction_rating, null: false
t.timestamps
end
add_index :surveys, :author_id
add_index :surveys, :zipcode
add_index :surveys, :state
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment