[Osaas-commits] r21 - in trunk: . server/osaas server/test

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 28 20:43:34 CEST 2007


Author: bh
Date: 2007-08-28 20:43:34 +0200 (Tue, 28 Aug 2007)
New Revision: 21

Modified:
   trunk/ChangeLog
   trunk/server/osaas/dbbackend.py
   trunk/server/test/test_dbbackend.py
Log:
* server/test/test_dbbackend.py (TestDBBackend.test_create_tables):
Adapt test case

* server/osaas/dbbackend.py (DBBackend.create_tables): Make the ID
column a primary key


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-08-28 18:42:22 UTC (rev 20)
+++ trunk/ChangeLog	2007-08-28 18:43:34 UTC (rev 21)
@@ -1,5 +1,13 @@
 2007-08-28  Bernhard Herzog  <bh at intevation.de>
 
+	* server/test/test_dbbackend.py (TestDBBackend.test_create_tables):
+	Adapt test case
+
+	* server/osaas/dbbackend.py (DBBackend.create_tables): Make the ID
+	column a primary key
+
+2007-08-28  Bernhard Herzog  <bh at intevation.de>
+
 	* server/osaas/run.py (OSAASServerProgram.instantiate_server): Use
 	the logger httpserver.error.dbbackend instead of dbbackend
 

Modified: trunk/server/osaas/dbbackend.py
===================================================================
--- trunk/server/osaas/dbbackend.py	2007-08-28 18:42:22 UTC (rev 20)
+++ trunk/server/osaas/dbbackend.py	2007-08-28 18:43:34 UTC (rev 21)
@@ -87,7 +87,7 @@
                 lines = []
                 lines.append("CREATE TABLE %s" % rule.table)
                 lines.append("(")
-                fieldlines = ["    ID INT"]
+                fieldlines = ["    ID INT PRIMARY KEY"]
                 for field in rule.fields:
                     fieldlines.append("    %s %s"
                                       % (field.column, field.column_type))

Modified: trunk/server/test/test_dbbackend.py
===================================================================
--- trunk/server/test/test_dbbackend.py	2007-08-28 18:42:22 UTC (rev 20)
+++ trunk/server/test/test_dbbackend.py	2007-08-28 18:43:34 UTC (rev 21)
@@ -89,7 +89,7 @@
                           [('Cursor.execute', ('CREATE SEQUENCE mytable_seq',)),
                            ("Cursor.execute", ("CREATE TABLE mytable\n"
                                                "(\n"
-                                               "    ID INT,\n"
+                                               "    ID INT PRIMARY KEY,\n"
                                                "    req character varying(11)\n"
                                                ")",)),
                            ("Connection.commit",)])



More information about the Osaas-commits mailing list