diff --git a/install/mysql.sql b/install/mysql.sql index 9b01e32..66c4bb3 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -31,4 +31,19 @@ CREATE TABLE IF NOT EXISTS `users_config` ( `name` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE tags ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE tags_entries ( + `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`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/install/postgres.sql b/install/postgres.sql index 9e0e827..fe8f559 100644 --- a/install/postgres.sql +++ b/install/postgres.sql @@ -27,4 +27,15 @@ CREATE TABLE users_config ( user_id integer NOT NULL, name varchar(255) NOT NULL, value varchar(255) NOT NULL -); \ No newline at end of file +); + +CREATE TABLE tags ( + id bigserial primary key, + value varchar(255) NOT NULL +); + +CREATE TABLE tags_entries ( + id bigserial primary key, + entry_id integer NOT NULL, + tag_id integer NOT NULL +) \ No newline at end of file