add user model
This commit is contained in:
14
db/migrate/20210804230323_create_users.rb
Normal file
14
db/migrate/20210804230323_create_users.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
class CreateUsers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table(:users) do |t|
|
||||
t.string(:first_name, null: false)
|
||||
t.string(:last_name, null: false)
|
||||
t.string(:email, null: false)
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index(:users, :email, unique: true)
|
||||
end
|
||||
end
|
||||
11
db/schema.rb
generated
11
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_08_03_222524) do
|
||||
ActiveRecord::Schema.define(version: 2021_08_04_230323) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -27,4 +27,13 @@ ActiveRecord::Schema.define(version: 2021_08_03_222524) do
|
||||
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
||||
end
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "first_name", null: false
|
||||
t.string "last_name", null: false
|
||||
t.string "email", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user