Use engine for DDL
This commit is contained in:
parent
b5181a4105
commit
33908b2699
@ -84,7 +84,7 @@ class Database(object):
|
||||
table = SQLATable(table_name, self.metadata)
|
||||
col = Column('id', Integer, primary_key=True)
|
||||
table.append_column(col)
|
||||
table.create(self.executable)
|
||||
table.create(self.engine)
|
||||
self._tables[table_name] = table
|
||||
return Table(self, table)
|
||||
|
||||
|
||||
@ -202,7 +202,7 @@ class Table(object):
|
||||
if name not in self.table.columns.keys():
|
||||
col = Column(name, type)
|
||||
col.create(self.table,
|
||||
connection=self.database.executable)
|
||||
connection=self.database.engine)
|
||||
|
||||
def create_index(self, columns, name=None):
|
||||
"""
|
||||
@ -221,7 +221,7 @@ class Table(object):
|
||||
try:
|
||||
columns = [self.table.c[c] for c in columns]
|
||||
idx = Index(name, *columns)
|
||||
idx.create(self.database.executable)
|
||||
idx.create(self.database.engine)
|
||||
except:
|
||||
idx = None
|
||||
self.indexes[name] = idx
|
||||
|
||||
Loading…
Reference in New Issue
Block a user