some changes to support saved queries for new TKO
-migration to add saved_queries table.  this is different from the existing query_history table.  this feature is incompatible with the old one and I didn't want to interfere with the old one.
-various modifications to history handling across the board to allow better support for saved queries (the url will show up as just "saved_query=123", without all the extra crap)
-refactoring of apache_auth.py to allow new TKO to use it without using all the Django auth crap


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1810 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/migrations/010_add_saved_queries.py b/tko/migrations/010_add_saved_queries.py
new file mode 100644
index 0000000..a7ff0f6
--- /dev/null
+++ b/tko/migrations/010_add_saved_queries.py
@@ -0,0 +1,20 @@
+UP_SQL = """
+CREATE TABLE `saved_queries` (
+    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
+    `owner` varchar(80) NOT NULL,
+    `name` varchar(100) NOT NULL,
+    `url_token` longtext NOT NULL
+);
+
+"""
+
+DOWN_SQL = """
+DROP TABLE IF EXISTS `saved_queries`;
+"""
+
+def migrate_up(manager):
+    manager.execute(UP_SQL)
+
+
+def migrate_down(manager):
+    manager.execute(DOWN_SQL)