'disk_table',
'types_table',
'cdroms_table',
+ 'mirrors_table',
'autoinstalls_table',
'Machine',
'MachineAccess',
'Disk',
'Type',
'CDROM',
+ 'Mirror',
'Autoinstall',
'or_',
]
Column('owner', String, nullable=False),
Column('contact', String, nullable=False),
Column('uuid', String, nullable=False),
- Column('administrator', String, nullable=False, default=False),
+ Column('administrator', String, nullable=True, default=None),
Column('type_id', String, ForeignKey('types.type_id'), nullable=False),
Column('autorestart', Boolean, nullable=False, default=False),
Column('cpus', Integer, nullable=False, default=1),
cdroms_table = Table('cdroms', meta,
Column('cdrom_id', String, primary_key=True, nullable=False),
Column('description', String, nullable=False),
- Column('mirror_id', String, ForeignKey('mirrors.mirror_id'),
+ Column('mirror_id', String, ForeignKey('mirrors.mirror_id')),
Column('uri_suffix', String))
autoinstalls_table = Table('autoinstalls', meta,
Column('description', String, nullable=False),
Column('type_id', String, ForeignKey('types.type_id'), nullable=False),
Column('distribution', String, nullable=False),
- Column('mirror', String, nullable=False))
+ Column('mirror', String, nullable=False),
+ Column('arch', String, nullable=False))
machine_access_table = Table('machine_access', meta,
Column('machine_id', Integer, ForeignKey('machines.machine_id', ondelete='CASCADE'), nullable=False, index=True),
session.mapper(Disk, disk_table)
session.mapper(Type, types_table)
session.mapper(Mirror, mirrors_table)
-session.mapper(CDROM, cdroms_table)
+session.mapper(CDROM, cdroms_table,
+ properties={'mirror': relation(Mirror, backref="cdroms")})
session.mapper(Autoinstall, autoinstalls_table)
def clear_cache():