From: Greg Price <price@mit.edu>
Date: Fri, 24 Oct 2008 03:04:03 +0000 (-0400)
Subject: yet another new-sqlalchemy fix, this one post-0.4.2; grr
X-Git-Tag: sipb-xen-database/10.34^0
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/commitdiff_plain/69ff84f7de3d72cda2e49f6125268475db6f41ad

yet another new-sqlalchemy fix, this one post-0.4.2; grr

svn path=/trunk/packages/sipb-xen-database/; revision=1174
---

diff --git a/debian/changelog b/debian/changelog
index b98b9d6..e3406a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+sipb-xen-database (10.34) unstable; urgency=low
+
+  * yet another new-sqlalchemy fix, this one post-0.4.2
+
+ -- Greg Price <price@mit.edu>  Thu, 23 Oct 2008 23:02:46 -0400
+
 sipb-xen-database (10.33) unstable; urgency=low
 
   * Catch calls to restart Postgres and translate them into a sequential
diff --git a/python/database/models.py b/python/database/models.py
index df3707f..793bc80 100644
--- a/python/database/models.py
+++ b/python/database/models.py
@@ -74,9 +74,9 @@ autoinstalls_table = Table('autoinstalls', meta,
        Column('mirror', String, nullable=False))
 
 machine_access_table = Table('machine_access', meta,
-       Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=False, index=True),
+       Column('machine_id', Integer, ForeignKey('machines.machine_id', ondelete='CASCADE'), nullable=False, index=True),
        Column('user', String, nullable=False, index=True),
-       PrimaryKeyConstraint('machine_id', 'user', ondelete='CASCADE'))
+       PrimaryKeyConstraint('machine_id', 'user'))
 
 class Machine(object):
     def __repr__(self):