Make migration more robust
This commit is contained in:
parent
8d68a97ab1
commit
50c9dbe7b3
2 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
class AddAccessoryAndTypeToJobs < ActiveRecord::Migration[7.0]
|
class AddAccessoryAndTypeToJobs < ActiveRecord::Migration[7.0]
|
||||||
def change
|
def change
|
||||||
add_column :jobs, :accessory, :boolean, default: false
|
add_column :jobs, :accessory, :boolean, default: false unless column_exists?(:jobs, :accessory)
|
||||||
add_column :jobs, :accessory_type, :integer, default: 0
|
add_column :jobs, :accessory_type, :integer, default: 0 unless column_exists?(:jobs, :accessory_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,12 @@
|
||||||
#
|
#
|
||||||
# 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[7.0].define(version: 2023_01_28_091710) do
|
ActiveRecord::Schema[7.0].define(version: 2023_01_30_114432) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "btree_gin"
|
enable_extension "btree_gin"
|
||||||
enable_extension "pg_trgm"
|
enable_extension "pg_trgm"
|
||||||
enable_extension "pgcrypto"
|
enable_extension "pgcrypto"
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
enable_extension "timescaledb"
|
|
||||||
|
|
||||||
create_table "app_updates", primary_key: "updated_at", id: :datetime, force: :cascade do |t|
|
create_table "app_updates", primary_key: "updated_at", id: :datetime, force: :cascade do |t|
|
||||||
t.string "update_type", null: false
|
t.string "update_type", null: false
|
||||||
|
|
@ -155,6 +154,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_28_091710) do
|
||||||
t.integer "order"
|
t.integer "order"
|
||||||
t.uuid "base_job_id"
|
t.uuid "base_job_id"
|
||||||
t.string "granblue_id"
|
t.string "granblue_id"
|
||||||
|
t.boolean "accessory", default: false
|
||||||
|
t.integer "accessory_type", default: 0
|
||||||
t.index ["base_job_id"], name: "index_jobs_on_base_job_id"
|
t.index ["base_job_id"], name: "index_jobs_on_base_job_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue