Commit 762e43db by Mai Hoang Thai Ha

created migration

parent 78e66c7c
Pipeline #1330 canceled with stages
in 0 seconds
class Job < ApplicationRecord class Job < ApplicationRecord
belongs_to :company belongs_to :company
has_and_belongs_to_many :industries has_and_belongs_to_many :industries
has_and_belongs_to_many :cities has_and_belongs_to_many :cities
has_many :apply_jobs has_many :apply_jobs
has_many :history_jobs has_many :history_jobs
has_many :favorite_jobs has_many :favorite_jobs
......
...@@ -2,17 +2,19 @@ class CreateUsers < ActiveRecord::Migration[6.1] ...@@ -2,17 +2,19 @@ class CreateUsers < ActiveRecord::Migration[6.1]
def change def change
create_table :users do |t| create_table :users do |t|
t.string :name t.string :name
t.string :email t.string :email, null: false
t.string :password_digest t.string :password_digest
t.string :remember_digest t.string :remember_digest
t.boolean :admin t.boolean :admin, default: false
t.string :activation_digest t.string :activation_digest
t.boolean :activated t.boolean :activated, default: false
t.datetime :activated_at t.datetime :activated_at
t.string :password_reset_digest t.string :password_reset_digest
t.datetime :password_reset_sent_at t.datetime :password_reset_sent_at
t.timestamps t.timestamps
end end
add_index :users, :email, unique: true
add_index :user, :password_reset_digest, unique: true
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment