add user model

This commit is contained in:
João Geonizeli
2021-08-04 20:32:58 -03:00
parent a90855c5af
commit 41e3119953
10 changed files with 156 additions and 8 deletions

View 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
View File

@@ -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