Skip to content

Commit

Permalink
Drop upgrade argument from copy_database (too ambiguous) and version …
Browse files Browse the repository at this point in the history
…bump.
  • Loading branch information
Manuel Marin committed Mar 25, 2019
1 parent fe11f33 commit d88d78f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions spinedatabase_api/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,8 @@ def attr_dict(item):
return {c.key: getattr(item, c.key) for c in inspect(item).mapper.column_attrs}


def copy_database(dest_url, source_url, upgrade=False, overwrite=True, only_tables=set(), skip_tables=set()):
def copy_database(dest_url, source_url, overwrite=True, only_tables=set(), skip_tables=set()):
"""Copy the database from source_url into dest_url."""
# Upgrading stuff
if not is_head(source_url):
if not upgrade:
raise SpineDBVersionError(url=source_url)
try:
upgrade_to_head(source_url)
except (DBAPIError, NoSuchTableError):
pass
if not is_head(dest_url):
if not upgrade:
raise SpineDBVersionError(url=dest_url)
try:
upgrade_to_head(dest_url)
except (DBAPIError, NoSuchTableError):
pass
# Copy db
source_engine = create_engine(source_url)
dest_engine = create_engine(dest_url)
Expand Down
2 changes: 1 addition & 1 deletion spinedatabase_api/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.19"
__version__ = "0.0.20"

0 comments on commit d88d78f

Please sign in to comment.