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
|
||||
Reference in New Issue
Block a user