summaryrefslogtreecommitdiff
path: root/tko/migrations
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-21 17:10:57 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-21 17:10:57 +0000
commit6d9aac8bb08f8e1ad4eba0cc4e83840127075d88 (patch)
treee3b5e858e2d791b06a9adb1899c509aa238ded2c /tko/migrations
parentd0acd356678df7f901118f32a3ed6124786dbae5 (diff)
Overview:
Implement user's request: save query on demand a) Add to TKO greed view a form containing button [SaveQuery] and edit control for optional comments b) On saveQuery request TKO make sure that user's cookies contain a unique user's id c) ... and then write into table query_history in TKO: time stamp, comment, uid, url of the query d) Make sure user can read saved queries back ( can read only his/her own queries ) compose_query.cgi - added a form that supports user's request to save cu rrent query save_query.cgi - saves the query query_history.cgi - shows saved queries by this user unique_cookie.py - common cookie related function: set/get user's unique id 006_add_table_query_history.py - database migration. New table introduce d for query history. From: vsamarsk@google.com git-svn-id: svn://test.kernel.org/autotest/trunk@1533 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/migrations')
-rw-r--r--tko/migrations/006_add_table_query_history.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tko/migrations/006_add_table_query_history.py b/tko/migrations/006_add_table_query_history.py
new file mode 100644
index 00000000..54b514da
--- /dev/null
+++ b/tko/migrations/006_add_table_query_history.py
@@ -0,0 +1,18 @@
+def migrate_up(manager):
+ manager.execute_script(ADD_TABLE_QUERY_HISTORY)
+
+
+def migrate_down(manager):
+ manager.execute_script(DROP_TABLE_QUERY_HISTORY)
+
+
+ADD_TABLE_QUERY_HISTORY = """
+CREATE TABLE IF NOT EXISTS query_history
+(uid VARCHAR(32), time_created VARCHAR(32), user_comment VARCHAR(256),
+url VARCHAR(65534));
+"""
+
+DROP_TABLE_QUERY_HISTORY = """
+DROP TABLE query_history;
+"""
+