Commit 9b293818 by Trịnh Hoàng Phúc

Fix review 11/05/2020

parent ff55254b
Pipeline #609 failed with stages
in 0 seconds
class City < ApplicationRecord class City < ApplicationRecord
validates :title, presence: true
has_and_belongs_to_many :jobs has_and_belongs_to_many :jobs
end end
class Company < ApplicationRecord class Company < ApplicationRecord
validates :title, presence: true
has_many :jobs has_many :jobs
end end
class Industry < ApplicationRecord class Industry < ApplicationRecord
validates :title, presence: true
has_and_belongs_to_many :jobs has_and_belongs_to_many :jobs
end end
class Job < ApplicationRecord class Job < ApplicationRecord
validates :title, presence: true
belongs_to :company belongs_to :company
has_many :applies has_many :applies
......
class AddColumnsToJobs < ActiveRecord::Migration[6.0]
def change
add_column :jobs, :min_salary, :bigint, :default => 0
add_column :jobs, :max_salary, :bigint, :default => 0
add_column :jobs, :benefit, :text
add_column :jobs, :job_requirements, :text
add_column :jobs, :other_information, :text
end
end
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_04_23_044651) do ActiveRecord::Schema.define(version: 2020_05_11_055632) do
create_table "admins", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "admins", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token" t.string "reset_password_token"
...@@ -24,7 +24,7 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do ...@@ -24,7 +24,7 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do
t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true
end end
create_table "applies", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "applies", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "user_id", null: false t.bigint "user_id", null: false
t.bigint "job_id", null: false t.bigint "job_id", null: false
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
...@@ -33,21 +33,21 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do ...@@ -33,21 +33,21 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do
t.index ["user_id"], name: "index_applies_on_user_id" t.index ["user_id"], name: "index_applies_on_user_id"
end end
create_table "cities", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "cities", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "title" t.string "title"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.boolean "foreign", default: false t.boolean "foreign", default: false
end end
create_table "cities_jobs", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "cities_jobs", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "city_id", null: false t.bigint "city_id", null: false
t.bigint "job_id", null: false t.bigint "job_id", null: false
t.index ["city_id", "job_id"], name: "index_cities_jobs_on_city_id_and_job_id" t.index ["city_id", "job_id"], name: "index_cities_jobs_on_city_id_and_job_id"
t.index ["job_id", "city_id"], name: "index_cities_jobs_on_job_id_and_city_id" t.index ["job_id", "city_id"], name: "index_cities_jobs_on_job_id_and_city_id"
end end
create_table "companies", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "companies", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "title" t.string "title"
t.string "address" t.string "address"
t.string "logo" t.string "logo"
...@@ -56,7 +56,7 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do ...@@ -56,7 +56,7 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
end end
create_table "favorites", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "favorites", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "user_id", null: false t.bigint "user_id", null: false
t.bigint "job_id", null: false t.bigint "job_id", null: false
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
...@@ -65,20 +65,20 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do ...@@ -65,20 +65,20 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do
t.index ["user_id"], name: "index_favorites_on_user_id" t.index ["user_id"], name: "index_favorites_on_user_id"
end end
create_table "industries", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "industries", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "title" t.string "title"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
end end
create_table "industries_jobs", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "industries_jobs", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "industry_id", null: false t.bigint "industry_id", null: false
t.bigint "job_id", null: false t.bigint "job_id", null: false
t.index ["industry_id", "job_id"], name: "index_industries_jobs_on_industry_id_and_job_id" t.index ["industry_id", "job_id"], name: "index_industries_jobs_on_industry_id_and_job_id"
t.index ["job_id", "industry_id"], name: "index_industries_jobs_on_job_id_and_industry_id" t.index ["job_id", "industry_id"], name: "index_industries_jobs_on_job_id_and_industry_id"
end end
create_table "jobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "jobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "title" t.string "title"
t.string "updated_date_job" t.string "updated_date_job"
t.string "level" t.string "level"
...@@ -89,10 +89,15 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do ...@@ -89,10 +89,15 @@ ActiveRecord::Schema.define(version: 2020_04_23_044651) do
t.bigint "company_id" t.bigint "company_id"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.bigint "min_salary", default: 0
t.bigint "max_salary", default: 0
t.text "benefit"
t.text "job_requirements"
t.text "other_information"
t.index ["company_id"], name: "index_jobs_on_company_id" t.index ["company_id"], name: "index_jobs_on_company_id"
end end
create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token" t.string "reset_password_token"
......
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