-- don't replicate this up script to not break 2.8->3.0 upgrade

CREATE DATABASE IF NOT EXISTS prosody;
GRANT ALL PRIVILEGES ON prosody.* TO 'prosody'@'localhost' IDENTIFIED BY 'PW_PROSODY';
GRANT SELECT ON provisioning.voip_preferences TO prosody@localhost;
GRANT SELECT ON provisioning.voip_usr_preferences TO prosody@localhost;
GRANT SELECT ON provisioning.voip_dom_preferences TO prosody@localhost;
GRANT SELECT ON kamailio.dbaliases TO prosody@localhost;
GRANT SELECT ON kamailio.subscriber TO prosody@localhost;
GRANT SELECT ON kamailio.domain TO prosody@localhost;

CREATE TABLE IF NOT EXISTS prosody.prosody (
  `host` text,
  `user` text,
  `store` text,
  `key` text,
  `type` text,
  `value` mediumtext,
  KEY `prosody_index` (`host`(20),`user`(20),`store`(20),`key`(20))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
