diff --git a/db/migrate/20221120055510_add_job_skills_table.rb b/db/migrate/20221120055510_add_job_skills_table.rb new file mode 100644 index 0000000..b21a873 --- /dev/null +++ b/db/migrate/20221120055510_add_job_skills_table.rb @@ -0,0 +1,14 @@ +class AddJobSkillsTable < ActiveRecord::Migration[6.1] + def change + create_table :job_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :job, type: :uuid + t.string :name_en, null: false, unique: true + t.string :name_jp, null: false, unique: true + t.string :slug, null: false, unique: true + t.integer :color, null: false + t.boolean :main, default: false + t.boolean :sub, default: false + t.boolean :emp, default: false + end + end +end diff --git a/db/migrate/20221120065331_remove_null_constraint_from_job_skills.rb b/db/migrate/20221120065331_remove_null_constraint_from_job_skills.rb new file mode 100644 index 0000000..8aa1a7f --- /dev/null +++ b/db/migrate/20221120065331_remove_null_constraint_from_job_skills.rb @@ -0,0 +1,6 @@ +class RemoveNullConstraintFromJobSkills < ActiveRecord::Migration[6.1] + def change + change_column :job_skills, :name_en, :string, unique: false + change_column :job_skills, :name_jp, :string, unique: false + end +end diff --git a/db/migrate/20221120075133_add_order_to_job_skills.rb b/db/migrate/20221120075133_add_order_to_job_skills.rb new file mode 100644 index 0000000..c244627 --- /dev/null +++ b/db/migrate/20221120075133_add_order_to_job_skills.rb @@ -0,0 +1,5 @@ +class AddOrderToJobSkills < ActiveRecord::Migration[6.1] + def change + add_column :job_skills, :order, :integer + end +end diff --git a/db/migrate/20221120135403_add_base_and_group_to_job_skills.rb b/db/migrate/20221120135403_add_base_and_group_to_job_skills.rb new file mode 100644 index 0000000..1644821 --- /dev/null +++ b/db/migrate/20221120135403_add_base_and_group_to_job_skills.rb @@ -0,0 +1,6 @@ +class AddBaseAndGroupToJobSkills < ActiveRecord::Migration[6.1] + def change + add_column :job_skills, :base, :boolean, default: false + add_column :job_skills, :group, :integer + end +end diff --git a/db/migrate/20221120145204_remove_group_from_job_skills.rb b/db/migrate/20221120145204_remove_group_from_job_skills.rb new file mode 100644 index 0000000..6f82de9 --- /dev/null +++ b/db/migrate/20221120145204_remove_group_from_job_skills.rb @@ -0,0 +1,5 @@ +class RemoveGroupFromJobSkills < ActiveRecord::Migration[6.1] + def change + remove_column :job_skills, :group, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 9d4fe9d..748bd82 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_11_17_070255) do +ActiveRecord::Schema.define(version: 2022_11_20_145204) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" @@ -102,6 +102,20 @@ ActiveRecord::Schema.define(version: 2022_11_17_070255) do t.index ["weapon_id"], name: "index_grid_weapons_on_weapon_id" end + create_table "job_skills", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.uuid "job_id" + t.string "name_en", null: false + t.string "name_jp", null: false + t.string "slug", null: false + t.integer "color", null: false + t.boolean "main", default: false + t.boolean "sub", default: false + t.boolean "emp", default: false + t.integer "order" + t.boolean "base", default: false + t.index ["job_id"], name: "index_job_skills_on_job_id" + end + create_table "jobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name_en" t.string "name_jp"