X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/blobdiff_plain/ecbc2480383113933e782abee312f7c42e8fdd55..3c950566d10970612ddba0ad68ad45b2908da5d0:/invirt-database-tables diff --git a/invirt-database-tables b/invirt-database-tables index 0b37bfc..78c7ab4 100755 --- a/invirt-database-tables +++ b/invirt-database-tables @@ -10,10 +10,22 @@ def usage(): if len(sys.argv) == 1: usage() +def create(): + database.meta.create_all() + session = database.session() + session.begin() + 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() if sys.argv[1] == "create": - database.meta.create_all() + create() elif sys.argv[1] == "drop": database.meta.drop_all() else: