extra check before column creation

This commit is contained in:
Friedrich Lindenberg 2017-09-24 10:41:08 +03:00
parent db9c41a090
commit 1fd19f37b9
2 changed files with 5 additions and 3 deletions

View File

@ -247,7 +247,8 @@ class Table(object):
with self.db.lock:
self._threading_warn()
for column in columns:
self.db.op.add_column(self.name, column, self.db.schema)
if not self.has_column(column.name):
self.db.op.add_column(self.name, column, self.db.schema)
self._reflect_table()
def _sync_columns(self, row, ensure, types=None):

View File

@ -8,7 +8,7 @@ if sys.version_info[:2] <= (2, 6):
setup(
name='dataset',
version='1.0.1',
version='1.0.2',
description="Toolkit for Python-based database access.",
long_description="",
classifiers=[
@ -19,7 +19,8 @@ setup(
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
keywords='sql sqlalchemy etl loading utility',
author='Friedrich Lindenberg, Gregor Aisch, Stefan Wehrmeyer',