From 6bf4702608e4f32d66a9840ec93461f653315a76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= <nicolas.loeuillet@gmail.com>
Date: Fri, 6 Dec 2013 15:16:02 +0100
Subject: [add] tags and tags_entries for mysql & postgresql

---
 install/mysql.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'install/mysql.sql')

diff --git a/install/mysql.sql b/install/mysql.sql
index 9b01e32c..66c4bb31 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
-- 
cgit v1.2.3

