2022-09-20 22:07:06 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class EnforceUserProfileMaxLimits < ActiveRecord::Migration[7.0]
|
|
|
|
def change
|
2022-09-21 15:14:45 -04:00
|
|
|
execute "UPDATE user_profiles SET location = LEFT(location, 3000) WHERE location IS NOT NULL AND LENGTH(location) > 3000"
|
|
|
|
execute "UPDATE user_profiles SET website = LEFT(website, 3000) WHERE website IS NOT NULL AND LENGTH(website) > 3000"
|
2022-09-20 22:07:06 -04:00
|
|
|
|
|
|
|
change_column :user_profiles, :location, :string, limit: 3000
|
|
|
|
change_column :user_profiles, :website, :string, limit: 3000
|
|
|
|
end
|
|
|
|
end
|