invirt-database-server (0.0.10) unstable; urgency=low
+ [ Greg Price ]
* invirt-database-tables: populate types table
- -- Greg Price <price@mit.edu> Sat, 31 Jan 2009 03:49:33 -0500
+ [ Evan Broder ]
+ * Conditionalize populating the types table on the types not being there
+ already.
+
+ -- Evan Broder <broder@mit.edu> Sat, 31 Jan 2009 03:58:16 -0500
invirt-database-server (0.0.9) unstable; urgency=low
database.meta.create_all()
session = database.session()
session.begin()
- session.save(database.Type(type_id='linux-hvm', description='HVM',
- hvm='t', apic='t', acpi='t', pae='t'))
- session.save(database.Type(type_id='linux', description='ParaVM',
- hvm='f', apic='f', acpi='f', pae='f'))
+ if not database.Type.query.get('linux-hvm'):
+ session.save(database.Type(type_id='linux-hvm', description='HVM',
+ hvm='t', apic='t', acpi='t', pae='t'))
+ if not database.Type.query.get('linux'):
+ session.save(database.Type(type_id='linux', description='ParaVM',
+ hvm='f', apic='f', acpi='f', pae='f'))
session.commit()
database.connect()