diff roundup/backends/back_postgresql.py @ 2077:3e0961d6d44d

Added the "actor" property. Metakit backend not done (still not confident I know how it's supposed to work ;) Currently it will come up as NULL in the RDBMS backends for older items. The *dbm backends will look up the journal. I hope to remedy the former before 0.7's release. Fixed a bunch of migration issues in the rdbms backends while I was at it (index changes for key prop changes) and simplified the class table update code for RDBMSes that have "alter table" in their command set (ie. not sqlite) ... migration from "version 1" to "version 2" still hasn't actually been tested yet though.
author Richard Jones <richard@users.sourceforge.net>
date Mon, 15 Mar 2004 05:50:20 +0000
parents b1704ba7be41
children c091cacdc505
line wrap: on
line diff
--- a/roundup/backends/back_postgresql.py	Fri Mar 12 05:36:26 2004 +0000
+++ b/roundup/backends/back_postgresql.py	Mon Mar 15 05:50:20 2004 +0000
@@ -115,6 +115,13 @@
             's_last_use FLOAT(20), s_user VARCHAR(255))')
         self.cursor.execute('CREATE INDEX sessions_key_idx ON sessions(s_key)')
 
+    def add_actor_column(self):
+        # update existing tables to have the new actor column
+        tables = self.database_schema['tables']
+        for name in tables.keys():
+            self.cursor.execute('ALTER TABLE _%s add __actor '
+                'VARCHAR(255)'%name)
+
     def __repr__(self):
         return '<roundpsycopgsql 0x%x>' % id(self)
 
@@ -140,6 +147,7 @@
             print >>hyperdb.DEBUG, 'create_class', (self, sql)
 
         self.cursor.execute(sql)
+        self.create_class_table_indexes(spec)
         return cols, mls
 
     def create_journal_table(self, spec):
@@ -151,6 +159,7 @@
             print >>hyperdb.DEBUG, 'create_class', (self, sql)
 
         self.cursor.execute(sql)
+        self.create_journal_table_indexes(spec)
 
     def create_multilink_table(self, spec, ml):
         sql = '''CREATE TABLE "%s_%s" (linkid VARCHAR(255),
@@ -160,6 +169,7 @@
             print >>hyperdb.DEBUG, 'create_class', (self, sql)
 
         self.cursor.execute(sql)
+        self.create_multilink_table_indexes(spec, ml)
 
 class Class(rdbms_common.Class):
     pass

Roundup Issue Tracker: http://roundup-tracker.org/