create database mailstats;
create user 'mailstats'@'%' identified by 'mailstats';
grant all on mailstats.* to 'mailstats'@'%' identified by 'mailstats' with grant option;
flush privileges;
use mailstats;


SET FOREIGN_KEY_CHECKS=0;

-- Table structure for table `session`

CREATE TABLE `stats` (
 `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
 `node` varchar(20) NOT NULL,
 `last_update` TIMESTAMP DEFAULT NOW(),
 `domain` varchar(20) NOT NULL,
 `user` varchar(20) NOT NULL,
 `size` BIGINT UNSIGNED NOT NULL,
 PRIMARY KEY(`id`)
) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

SET FOREIGN_KEY_CHECKS=1;
