CREATE TABLE IF NOT EXISTS `web-push-clients` ( 
	`id` INT NOT NULL AUTO_INCREMENT, 
	`endpoint` VARCHAR(300) NOT NULL, 
	`p256dh` VARCHAR(150) NOT NULL UNIQUE, 
	`auth` VARCHAR(50) NOT NULL UNIQUE, 
	`country` VARCHAR(250) NOT NULL, 
	`city` VARCHAR(250) NOT NULL, 
	`ip` VARCHAR(100) NOT NULL, 
	`user-agent` VARCHAR(250) NULL, 
	PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `web-push-queue` ( 
	`id` INT NOT NULL AUTO_INCREMENT, 
	`clients` TEXT NOT NULL COMMENT 'JSON', 
	`title` VARCHAR(250) NOT NULL, 
	`body` TEXT NOT NULL,
	`link` TEXT NOT NULL, 
	`icon` TEXT NOT NULL, 
	PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `web-push-user-to-clients` ( 
	`id` INT(11) NOT NULL AUTO_INCREMENT , 
	`user` INT(11) NOT NULL , 
	`client` INT(11) NOT NULL , 
	PRIMARY KEY (`id`)
) ENGINE = InnoDB; 