chore: Upgrade rails and ruby versions (#2400)
ruby version: 3.0.2 rails version: 6.1.4
This commit is contained in:
@@ -15,9 +15,7 @@ class AddSenderToMessages < ActiveRecord::Migration[6.0]
|
||||
# rubocop:disable Rails/SkipsModelValidations
|
||||
message.update_columns(sender_id: message.user.id, sender_type: 'User') if message.user.present?
|
||||
message.update_columns(sender_id: message.contact.id, sender_type: 'Contact') if message.contact.present?
|
||||
if message.sender.nil?
|
||||
message.update_columns(sender_id: message.conversation.contact.id, sender_type: 'Contact') if message.incoming?
|
||||
end
|
||||
message.update_columns(sender_id: message.conversation.contact.id, sender_type: 'Contact') if message.sender.nil? && message.incoming?
|
||||
# rubocop:enable Rails/SkipsModelValidations
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# This migration comes from active_storage (originally 20190112182829)
|
||||
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
unless column_exists?(:active_storage_blobs, :service_name)
|
||||
add_column :active_storage_blobs, :service_name, :string
|
||||
|
||||
if configured_service = ActiveStorage::Blob.service.name
|
||||
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
|
||||
end
|
||||
|
||||
change_column :active_storage_blobs, :service_name, :string, null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :active_storage_blobs, :service_name
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
# This migration comes from active_storage (originally 20191206030411)
|
||||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :active_storage_variant_records do |t|
|
||||
t.belongs_to :blob, null: false, index: false
|
||||
t.string :variation_digest, null: false
|
||||
|
||||
t.index %i[blob_id variation_digest], name: 'index_active_storage_variant_records_uniqueness', unique: true
|
||||
t.foreign_key :active_storage_blobs, column: :blob_id
|
||||
end
|
||||
end
|
||||
end
|
||||
12
db/schema.rb
12
db/schema.rb
@@ -2,8 +2,8 @@
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `rails
|
||||
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
@@ -79,9 +79,16 @@ ActiveRecord::Schema.define(version: 2021_07_23_095657) do
|
||||
t.bigint "byte_size", null: false
|
||||
t.string "checksum", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.string "service_name", null: false
|
||||
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
||||
end
|
||||
|
||||
create_table "active_storage_variant_records", force: :cascade do |t|
|
||||
t.bigint "blob_id", null: false
|
||||
t.string "variation_digest", null: false
|
||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||
end
|
||||
|
||||
create_table "agent_bot_inboxes", force: :cascade do |t|
|
||||
t.integer "inbox_id"
|
||||
t.integer "agent_bot_id"
|
||||
@@ -685,6 +692,7 @@ ActiveRecord::Schema.define(version: 2021_07_23_095657) do
|
||||
add_foreign_key "account_users", "accounts"
|
||||
add_foreign_key "account_users", "users"
|
||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "agent_bots", "accounts"
|
||||
add_foreign_key "campaigns", "accounts"
|
||||
add_foreign_key "campaigns", "inboxes"
|
||||
|
||||
Reference in New Issue
Block a user