Create the schema within a transaction
This commit is contained in:
parent
3b06bf10dd
commit
c7bbc01b20
@ -128,6 +128,8 @@ class DBAPI(DbGeneric):
|
|||||||
"""
|
"""
|
||||||
Create and update schema.
|
Create and update schema.
|
||||||
"""
|
"""
|
||||||
|
self.dbapi.begin()
|
||||||
|
|
||||||
# make sure schema is up to date:
|
# make sure schema is up to date:
|
||||||
self.dbapi.execute('CREATE TABLE person '
|
self.dbapi.execute('CREATE TABLE person '
|
||||||
'('
|
'('
|
||||||
@ -261,6 +263,7 @@ class DBAPI(DbGeneric):
|
|||||||
self.dbapi.execute('CREATE INDEX reference_obj_handle '
|
self.dbapi.execute('CREATE INDEX reference_obj_handle '
|
||||||
'ON reference(obj_handle)')
|
'ON reference(obj_handle)')
|
||||||
|
|
||||||
|
self.dbapi.commit()
|
||||||
|
|
||||||
def _close(self):
|
def _close(self):
|
||||||
self.dbapi.close()
|
self.dbapi.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user