Users & Auth
This commit is contained in:
15
db/migrate/20181110183741_create_users.rb
Normal file
15
db/migrate/20181110183741_create_users.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# 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
|
12
db/schema.rb
12
db/schema.rb
@ -10,6 +10,16 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 0) do
|
||||
ActiveRecord::Schema.define(version: 2018_11_10_183741) do
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "display_name", null: false
|
||||
t.string "email", null: false
|
||||
t.string "password_digest", null: false
|
||||
t.integer "role", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["email"], name: "index_users_on_email"
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user