@@ -0,0 +1,17 @@
|
||||
class RemoveSpecialCharactersFromInboxName < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
remove_special_characters_from_inbox_name
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def remove_special_characters_from_inbox_name
|
||||
::Inbox.find_in_batches do |inbox_batch|
|
||||
Rails.logger.info "Migrated till #{inbox_batch.first.id}\n"
|
||||
inbox_batch.each do |inbox|
|
||||
inbox.name = inbox.name.gsub(/[^\w\s_]/, '')
|
||||
inbox.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_06_10_091206) do
|
||||
ActiveRecord::Schema.define(version: 2022_06_16_154502) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
|
||||
Reference in New Issue
Block a user