Add guidebooks migration
This commit is contained in:
parent
44526d55e9
commit
26ce703df9
4 changed files with 34 additions and 1 deletions
12
db/migrate/20230418052314_add_guidebooks.rb
Normal file
12
db/migrate/20230418052314_add_guidebooks.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class AddGuidebooks < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :guidebooks, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||
t.string :granblue_id, null: false, unique: true
|
||||
t.string :name_en, null: false, unique: true
|
||||
t.string :name_jp, null: false, unique: true
|
||||
t.string :description_en, null: false
|
||||
t.string :description_jp, null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20230418052325_add_guidebooks_to_party.rb
Normal file
5
db/migrate/20230418052325_add_guidebooks_to_party.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddGuidebooksToParty < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :parties, :guidebooks, :uuid, array: true, default: [], null: false
|
||||
end
|
||||
end
|
||||
6
db/migrate/20230418061932_update_guidebooks_structure.rb
Normal file
6
db/migrate/20230418061932_update_guidebooks_structure.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class UpdateGuidebooksStructure < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
remove_column :guidebooks, :updated_at
|
||||
change_column_default :guidebooks, :created_at, -> { 'CURRENT_TIMESTAMP' }
|
||||
end
|
||||
end
|
||||
12
db/schema.rb
12
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_03_21_115930) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_04_18_061932) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "btree_gin"
|
||||
enable_extension "pg_trgm"
|
||||
|
|
@ -187,6 +187,15 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_21_115930) do
|
|||
t.index ["weapon_key3_id"], name: "index_grid_weapons_on_weapon_key3_id"
|
||||
end
|
||||
|
||||
create_table "guidebooks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.string "granblue_id", null: false
|
||||
t.string "name_en", null: false
|
||||
t.string "name_jp", null: false
|
||||
t.string "description_en", null: false
|
||||
t.string "description_jp", null: false
|
||||
t.datetime "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false
|
||||
end
|
||||
|
||||
create_table "job_accessories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "job_id"
|
||||
t.string "name_en", null: false
|
||||
|
|
@ -297,6 +306,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_21_115930) do
|
|||
t.string "edit_key"
|
||||
t.uuid "local_id"
|
||||
t.integer "ultimate_mastery"
|
||||
t.uuid "guidebooks", default: [], null: false, array: true
|
||||
t.index ["accessory_id"], name: "index_parties_on_accessory_id"
|
||||
t.index ["job_id"], name: "index_parties_on_job_id"
|
||||
t.index ["skill0_id"], name: "index_parties_on_skill0_id"
|
||||
|
|
|
|||
Loading…
Reference in a new issue