2013-08-07 09:46:17 -04:00
|
|
|
CREATE TABLE IF NOT EXISTS `config` (
|
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` varchar(255) NOT NULL,
|
|
|
|
`value` varchar(255) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2013-08-07 09:46:17 -04:00
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `entries` (
|
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`title` varchar(255) NOT NULL,
|
|
|
|
`url` varchar(255) NOT NULL,
|
2014-01-07 16:55:48 -05:00
|
|
|
`is_read` tinyint(1) NOT NULL DEFAULT 0,
|
|
|
|
`is_fav` tinyint(1) NOT NULL DEFAULT 0,
|
2013-08-07 09:46:17 -04:00
|
|
|
`content` blob NOT NULL,
|
|
|
|
`user_id` int(11) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2013-08-07 09:46:17 -04:00
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `users` (
|
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`username` varchar(255) NOT NULL,
|
|
|
|
`password` varchar(255) NOT NULL,
|
2014-01-07 16:55:48 -05:00
|
|
|
`name` varchar(255) NOT NULL,
|
2013-08-07 09:46:17 -04:00
|
|
|
`email` varchar(255) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2013-08-07 09:46:17 -04:00
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `users_config` (
|
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`user_id` int(11) NOT NULL,
|
|
|
|
`name` varchar(255) NOT NULL,
|
|
|
|
`value` varchar(255) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2013-12-06 09:16:02 -05:00
|
|
|
|
2013-12-19 08:24:49 -05:00
|
|
|
CREATE TABLE IF NOT EXISTS `tags` (
|
2013-12-06 09:16:02 -05:00
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`value` varchar(255) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2013-12-06 09:16:02 -05:00
|
|
|
|
2013-12-19 08:24:49 -05:00
|
|
|
CREATE TABLE IF NOT EXISTS `tags_entries` (
|
2013-12-06 09:16:02 -05:00
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
`entry_id` int(11) NOT NULL,
|
|
|
|
`tag_id` int(11) NOT NULL,
|
|
|
|
FOREIGN KEY(entry_id) REFERENCES entries(id) ON DELETE CASCADE,
|
|
|
|
FOREIGN KEY(tag_id) REFERENCES tags(id) ON DELETE CASCADE,
|
|
|
|
PRIMARY KEY (`id`)
|
2014-09-18 15:33:22 -04:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|