1
0
Fork 0
forked from OpenNeo/impress
impress/db/migrate/20240229015410_convert_all_tables_to_utf8mb4.rb

165 lines
6.8 KiB
Ruby
Raw Permalink Normal View History

class ConvertAllTablesToUtf8mb4 < ActiveRecord::Migration[7.1]
def change
# NOTE: This migration was generated by our `db:utf8_migration` task! It
# read the list of tables, compared them to the desired charset, and
# generated both SQL to convert to utf8mb4 and to reset back!
reversible do |direction|
direction.up do
execute <<-SQL
ALTER TABLE alt_styles CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE auth_servers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE campaigns CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE closet_hangers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE closet_lists CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE colors CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE contributions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE donation_features CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE donations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE item_outfit_relationships CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE items CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE login_cookies CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE modeling_logs CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE neopets_connections CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE outfits CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE parents_swf_assets CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE pet_loads CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE pet_states CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE pet_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE pets CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE schema_migrations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE species CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE swf_assets CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
execute <<-SQL
ALTER TABLE zones CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
SQL
end
direction.down do
execute <<-SQL
ALTER TABLE alt_styles CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
SQL
execute <<-SQL
ALTER TABLE auth_servers CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE campaigns CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE closet_hangers CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE closet_lists CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE colors CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE contributions CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE donation_features CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE donations CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE item_outfit_relationships CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE items CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci
SQL
execute <<-SQL
ALTER TABLE login_cookies CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE modeling_logs CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE neopets_connections CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE outfits CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE parents_swf_assets CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci
SQL
execute <<-SQL
ALTER TABLE pet_loads CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE pet_states CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci
SQL
execute <<-SQL
ALTER TABLE pet_types CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci
SQL
execute <<-SQL
ALTER TABLE pets CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE schema_migrations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
SQL
execute <<-SQL
ALTER TABLE species CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE swf_assets CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci
SQL
execute <<-SQL
ALTER TABLE users CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
execute <<-SQL
ALTER TABLE zones CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci
SQL
end
end
end
end