Switch default charset to UTF-8 in MySQL tables

master
Daniel Berteaud 11 years ago
parent f95e2730bd
commit e8eedce77c
  1. 18
      docs/schema.mysql
  2. 9
      docs/upgrade.mysql

@ -14,7 +14,7 @@ CREATE TABLE `rooms` (
`persistent` tinyint(1) DEFAULT '0', `persistent` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE (`name`) UNIQUE (`name`)
); ) DEFAULT CHARSET=utf8;
DROP VIEW IF EXISTS `turnusers_lt`; DROP VIEW IF EXISTS `turnusers_lt`;
CREATE VIEW `turnusers_lt` AS SELECT `name` AS `name`, MD5(CONCAT(CONCAT(CONCAT(CONCAT(`name`,':'),`realm`),':'),`token`)) AS `hmackey` FROM `rooms`; CREATE VIEW `turnusers_lt` AS SELECT `name` AS `name`, MD5(CONCAT(CONCAT(CONCAT(CONCAT(`name`,':'),`realm`),':'),`token`)) AS `hmackey` FROM `rooms`;
DROP TABLE IF EXISTS `participants`; DROP TABLE IF EXISTS `participants`;
@ -24,13 +24,13 @@ CREATE TABLE `participants` (
`peer_id` varchar(40) DEFAULT NULL, `peer_id` varchar(40) DEFAULT NULL,
`role` varchar(20) DEFAULT 'participant', `role` varchar(20) DEFAULT 'participant',
PRIMARY KEY (`id`,`participant`) PRIMARY KEY (`id`,`participant`)
); ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `notifications`; DROP TABLE IF EXISTS `notifications`;
CREATE TABLE `notifications` ( CREATE TABLE `notifications` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`email` varchar(254), `email` varchar(254),
PRIMARY KEY (`id`,`email`) PRIMARY KEY (`id`,`email`)
); ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `invitations`; DROP TABLE IF EXISTS `invitations`;
CREATE TABLE `invitations` ( CREATE TABLE `invitations` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
@ -40,8 +40,8 @@ CREATE TABLE `invitations` (
`response` varchar(20) DEFAULT NULL, `response` varchar(20) DEFAULT NULL,
`message` text DEFAULT NULL, `message` text DEFAULT NULL,
`processed` tinyint(1) DEFAULT '0', `processed` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`,`email`,`from`) PRIMARY KEY (`token`)
); ) DEFAULT CHARSET=utf8;
#DROP TABLE IF EXISTS `turnusers_lt`; #DROP TABLE IF EXISTS `turnusers_lt`;
#CREATE TABLE `turnusers_lt` ( #CREATE TABLE `turnusers_lt` (
# name varchar(512) PRIMARY KEY, # name varchar(512) PRIMARY KEY,
@ -51,17 +51,17 @@ DROP TABLE IF EXISTS `turnusers_st`;
CREATE TABLE `turnusers_st` ( CREATE TABLE `turnusers_st` (
name varchar(512) PRIMARY KEY, name varchar(512) PRIMARY KEY,
password varchar(512) password varchar(512)
); ) DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `turn_secret`; DROP TABLE IF EXISTS `turn_secret`;
CREATE TABLE `turn_secret` ( CREATE TABLE `turn_secret` (
value varchar(512) value varchar(512)
); ) DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `allowed_peer_ip`; DROP TABLE IF EXISTS `allowed_peer_ip`;
CREATE TABLE `allowed_peer_ip` ( CREATE TABLE `allowed_peer_ip` (
ip_range varchar(256) ip_range varchar(256)
); ) DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `denied_peer_ip`; DROP TABLE IF EXISTS `denied_peer_ip`;
CREATE TABLE `denied_peer_ip` ( CREATE TABLE `denied_peer_ip` (
ip_range varchar(256) ip_range varchar(256)
); ) DEFAULT CHARSET=latin1;

@ -2,11 +2,14 @@ ALTER TABLE `rooms` ADD COLUMN `owner_password` varchar(160) DEFAULT NULL AFTER
ALTER TABLE `rooms` ADD COLUMN `ask_for_name` tinyint(1) DEFAULT NULL AFTER `locked`; ALTER TABLE `rooms` ADD COLUMN `ask_for_name` tinyint(1) DEFAULT NULL AFTER `locked`;
ALTER TABLE `participants` ADD COLUMN `peer_id` varchar(40) DEFAULT NULL AFTER `participant`; ALTER TABLE `participants` ADD COLUMN `peer_id` varchar(40) DEFAULT NULL AFTER `participant`;
ALTER TABLE `participants` ADD COLUMN `role` varchar(20) DEFAULT 'participant' AFTER `peer_id`; ALTER TABLE `participants` ADD COLUMN `role` varchar(20) DEFAULT 'participant' AFTER `peer_id`;
ALTER TABLE `rooms` DEFAULT CHARACTER SET utf8;
ALTER TABLE `participants` DEFAULT CHARACTER SET utf8;
ALTER TABLE `notifications` DEFAULT CHARACTER SET utf8;
CREATE TABLE IF NOT EXISTS `notifications` ( CREATE TABLE IF NOT EXISTS `notifications` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`email` varchar(254), `email` varchar(254),
PRIMARY KEY (`id`,`email`) PRIMARY KEY (`id`,`email`)
); ) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `invitations` ( CREATE TABLE IF NOT EXISTS `invitations` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`email` varchar(254) NOT NULL, `email` varchar(254) NOT NULL,
@ -15,5 +18,5 @@ CREATE TABLE IF NOT EXISTS `invitations` (
`response` varchar(20) DEFAULT NULL, `response` varchar(20) DEFAULT NULL,
`message` text DEFAULT NULL, `message` text DEFAULT NULL,
`processed` tinyint(1) DEFAULT '0', `processed` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`,`email`,`from`) PRIMARY KEY (`token`)
); ) DEFAULT CHARSET=utf8;

Loading…
Cancel
Save