class FourByteUnicode < ActiveRecord::Migration
	def change
		reversible do |dir|
			dir.up do
execute('ALTER DATABASE greasyfork CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Activity CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_ActivityComment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_ActivityType CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_AnalyticsLocal CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Ban CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Category CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Comment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Conversation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_ConversationMessage CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Discussion CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Draft CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Flag MODIFY COLUMN `ForeignUrl` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_Flag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Invitation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Log CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Media CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Message CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Permission CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Photo CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Regarding MODIFY COLUMN `Type` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_Regarding CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Role CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Session CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Spammer CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_Tag MODIFY COLUMN `Name` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_Tag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_TagDiscussion CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_User MODIFY COLUMN `Email` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_User CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserAuthentication MODIFY COLUMN `ForeignUserKey` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_UserAuthentication CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserAuthenticationNonce MODIFY COLUMN `Nonce` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_UserAuthenticationNonce CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserAuthenticationProvider CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserAuthenticationToken CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserCategory CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserComment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserConversation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserDiscussion CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserMerge CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserMergeItem CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserMeta MODIFY COLUMN `Name` varchar(150) NOT NULL;')
execute('ALTER TABLE GDN_UserMeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserPoints CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE GDN_UserRole CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE allowed_requires CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE assessment_reasons CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE assessments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE author_email_notification_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE daily_install_counts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE delayed_jobs CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE disallowed_codes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE identities MODIFY COLUMN `provider` varchar(20) NOT NULL;')
execute('ALTER TABLE identities MODIFY COLUMN `uid` varchar(100) NOT NULL;')
execute('ALTER TABLE identities CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE install_counts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE licenses CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE locales CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE moderator_actions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE roles CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE roles_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE schema_migrations MODIFY COLUMN `version` varchar(150) NOT NULL;')
execute('ALTER TABLE schema_migrations CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_applies_tos CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_codes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_delete_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_set_automatic_set_inclusions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_set_automatic_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_set_script_inclusions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_set_set_inclusions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_sets CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_sync_sources CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_sync_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_types CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE script_versions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE scripts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
execute('ALTER TABLE users MODIFY COLUMN `email` varchar(150) NOT NULL DEFAULT "";')
execute('ALTER TABLE users MODIFY COLUMN `reset_password_token` varchar(150) NULL;')
execute('ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')
			end
		end
	end
end
