Changeset 592 for trunk/packages


Ignore:
Timestamp:
Jun 6, 2008, 12:25:15 PM (17 years ago)
Author:
ecprice
Message:

Specify ON DELETE CASCADE, use cascade= instead of deprecated
private=.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb_xen_database/models.py

    r589 r592  
    7070       Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=False, index=True),
    7171       Column('user', String, nullable=False, index=True),
    72        PrimaryKeyConstraint('machine_id', 'user'))
     72       PrimaryKeyConstraint('machine_id', 'user', ondelete='CASCADE'))
    7373
    7474class Machine(object):
     
    104104                          'disks': relation(Disk, backref="machine", lazy=False),
    105105                          'type': relation(Type, lazy=False),
    106                           'acl': relation(MachineAccess, backref="machine", lazy=False, private=True)});
     106                          'acl': relation(MachineAccess, backref="machine", lazy=False, passive_deletes=True, cascade="all, delete-orphan")});
    107107assign_mapper(ctx, MachineAccess, machine_access_table)
    108108assign_mapper(ctx, NIC, nic_table)
Note: See TracChangeset for help on using the changeset viewer.