Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateUsers < ActiveRecord::Migration
- def change
- create_table :users do |t|
- t.string :name
- t.string :email
- t.timestamps
- end
- end
- end
- rails generate migration add_index_to_users_email
- class AddIndexToUsersEmail < ActiveRecord::Migration
- def change
- end
- end
- ActiveRecord::Schema.define(version: 20131024161033) do
- create_table "users", force: true do |t|
- t.string "name"
- t.string "email"
- t.string "city"
- t.string "state"
- t.string "zip"
- t.string "mobile_phone"
- t.string "mobile_phone_type"
- t.date "birth_date"
- t.string "user_type"
- t.string "ss_num"
- t.boolean "agree_to_terms"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
- end
- rails generate migration add_index_to_users_email
- rails generate migration AddIndexToUsers email:string:index
- class AddIndexToUsers < ActiveRecord::Migration
- def change
- add_index :users, :email
- end
- end
- class AddIndexToUsersEmail < ActiveRecord::Migration
- def change
- add_index :users, :email, unique: true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement