Add job skills table
This commit is contained in:
parent
9708ed39e1
commit
b41a67df30
6 changed files with 51 additions and 1 deletions
14
db/migrate/20221120055510_add_job_skills_table.rb
Normal file
14
db/migrate/20221120055510_add_job_skills_table.rb
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
5
db/migrate/20221120075133_add_order_to_job_skills.rb
Normal file
5
db/migrate/20221120075133_add_order_to_job_skills.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddOrderToJobSkills < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :job_skills, :order, :integer
|
||||
end
|
||||
end
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class RemoveGroupFromJobSkills < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
remove_column :job_skills, :group, :integer
|
||||
end
|
||||
end
|
||||
16
db/schema.rb
16
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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue