ALTER DATABASE your_db_name DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_bot
			CHANGE name name varchar(245) NOT NULL default '';
ALTER TABLE bot_bots
			CHANGE botname botname varchar(245) NOT NULL default '';
ALTER TABLE bot_gmcache
			DROP KEY combined,
			ADD KEY combined (bot,combined(245));
ALTER TABLE bot_bot CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_bots CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_conversationlog CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_dstore CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_gmcache CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_gossip CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_patterns CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_templates CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_thatindex CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_thatstack CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_ban_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_config CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_lurkers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_messages CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_reg_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_stats CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE c_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE bot_bot
			CHANGE name name varchar(245) NOT NULL default '';
ALTER TABLE bot_bots
			CHANGE botname botname varchar(245) NOT NULL default '';
ALTER TABLE bot_gmcache
			DROP KEY combined,
			ADD KEY combined (bot,combined(245));
ALTER TABLE bot_conversationlog
			CHANGE enteredtime enteredtime datetime NOT NULL default CURRENT_TIMESTAMP;
ALTER TABLE bot_dstore
			CHANGE enteredtime enteredtime datetime NOT NULL default CURRENT_TIMESTAMP;
ALTER TABLE bot_patterns
			CHANGE word word varchar(245) default NULL;
ALTER TABLE bot_thatindex
			CHANGE enteredtime enteredtime datetime NOT NULL default CURRENT_TIMESTAMP;
ALTER TABLE bot_thatstack
			CHANGE value value text default NULL,
			CHANGE enteredtime enteredtime datetime NOT NULL default CURRENT_TIMESTAMP;

ALTER TABLE c_ban_users
			CHANGE ip ip varchar(100) NOT NULL default '',
			ADD country_code varchar(3) NOT NULL default '',
			ADD country_name varchar(100) NOT NULL default '';

ALTER TABLE c_config
			CHANGE MSG_DEL MSG_DEL smallint(5) UNSIGNED NOT NULL default '96',
			CHANGE GRAVATARS_DYNAMIC_DEF GRAVATARS_DYNAMIC_DEF enum('mm','identicon','monsterid','wavatar','retro') default 'monsterid',
			CHANGE INSTALL_DATE INSTALL_DATE date NOT NULL default (DATE(CURRENT_TIMESTAMP)),
			CHANGE LAST_SAVED_ON LAST_SAVED_ON datetime NOT NULL default CURRENT_TIMESTAMP,
			ADD USE_FLAGS enum('0','1') NOT NULL default '1',
			ADD SHOW_FLAGS enum('0','1') NOT NULL default '1',
			ADD NOTIFY_SOUND varchar(255) NOT NULL default 'sounds/notify.wav';

UPDATE c_config SET
			CHAT_SYSTEM = 'standalone',
			ALLOW_TEXT_COLORS = '1',
			MODS = 'Advanced Admin, (GR)Avatars, Smilies Popup, Color Drop Box, Private Popup,<br />Quick Menu, Logs Archive, Lurking, Color names, WorldTime, UTF-8, Birthdays, MathJax, TV/Radio, Emoji'
	WHERE ID='0';

ALTER TABLE c_lurkers
			CHANGE ip ip varchar(100) NOT NULL default '',
			ADD country_code varchar(3) NOT NULL default '',
			ADD country_name varchar(100) NOT NULL default '';

ALTER TABLE c_reg_users
			CHANGE ip ip varchar(100) NOT NULL default '',
			ADD country_code varchar(3) NOT NULL default '',
			ADD country_name varchar(100) NOT NULL default '';

ALTER TABLE c_stats
			CHANGE stat_date stat_date date NOT NULL default (DATE(CURRENT_TIMESTAMP)),
			ADD ip varchar(100) NOT NULL default '',
			ADD country_code varchar(3) NOT NULL default '',
			ADD country_name varchar(100) NOT NULL default '';

ALTER TABLE c_users
			CHANGE ip ip varchar(100) NOT NULL default '',
			ADD country_code varchar(3) NOT NULL default '',
			ADD country_name varchar(100) NOT NULL default '';