[evolvis-commits] r17749: - Added DB Script for advanced search

messer at evolvis.org messer at evolvis.org
Wed Nov 30 19:18:53 CET 2011


Author: messer
Date: 2011-11-30 19:18:53 +0100 (Wed, 30 Nov 2011)
New Revision: 17749

Added:
   branches/messer-51-suche/src/db/20111130-create-advanced-search-tables.sql
Log:
- Added DB Script for advanced search

Added: branches/messer-51-suche/src/db/20111130-create-advanced-search-tables.sql
===================================================================
--- branches/messer-51-suche/src/db/20111130-create-advanced-search-tables.sql	                        (rev 0)
+++ branches/messer-51-suche/src/db/20111130-create-advanced-search-tables.sql	2011-11-30 18:18:53 UTC (rev 17749)
@@ -0,0 +1,31 @@
+CREATE TABLE AdvancedQuery (
+	id serial PRIMARY KEY,
+	name VARCHAR(56) NOT NULL,
+	query TEXT NOT NULL
+);
+
+--This Table identifies all system wide querys (appearing in every tracker)
+CREATE TABLE AdvancedQuery_is_system_query (
+	query_id INT PRIMARY KEY references AdvancedQuery(id)
+);
+
+--This Table identifies all querys that are private by one user.
+CREATE TABLE user_has_query (
+	user_id INT references users(user_id),
+	query_id INT references AdvancedQuery(id),
+	group_artifact_id INT NOT NULL references artifact_group_list(group_artifact_id),
+	PRIMARY KEY (user_id, query_id, group_artifact_id)
+);
+
+--This Table identifies all querys that are global for one specific tracker.
+CREATE TABLE artifact_group_has_query (
+	group_artifact_id INT NOT NULL references artifact_group_list(group_artifact_id),
+	query_id INT references AdvancedQuery(id),
+	PRIMARY KEY (group_artifact_id, query_id)
+);
+
+GRANT ALL ON advancedquery_id_seq TO gforge;
+GRANT ALL ON AdvancedQuery TO gforge;
+GRANT ALL ON AdvancedQuery_is_system_query TO gforge;
+GRANT ALL ON user_has_query TO gforge;
+GRANT ALL ON artifact_group_has_query TO gforge;
\ No newline at end of file



More information about the evolvis-commits mailing list