1 DROP VIEW IF EXISTS recent_unique_plays;
3 CREATE VIEW recent_unique_plays AS
4 SELECT DISTINCT user_id, episode_id
7 AND DATEDIFF(NOW(), timestamp) <= 7;
10 DROP VIEW IF EXISTS episode_toplist;
12 CREATE VIEW episode_toplist AS
13 SELECT episode_id AS id, episode_id, count(episode_id) AS listeners
14 FROM recent_unique_plays
19 CREATE TABLE IF NOT EXISTS `security_tokens` (
20 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
21 `user_id` integer NOT NULL,
22 `token` varchar(32) NOT NULL,
23 `object` varchar(64) NOT NULL,
24 `action` varchar(10) NOT NULL