micro-blogger/db/migrate/20181110183741_create_users.rb

16 lines
387 B
Ruby
Raw Permalink Normal View History

2018-11-10 18:46:47 -06:00
# frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :display_name, null: false
t.string :email, null: false
t.string :password_digest, null: false
t.integer :role, null: false, default: 0
t.timestamps
end
add_index :users, :email
end
end