Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto committed Aug 22, 2023
1 parent 3c27987 commit 7edf25e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions python/auto_schema/auto_schema/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ def _get_custom_sql(self, connection, dialect) -> io.StringIO:
custom_sql_exclude = set(custom_sql_exclude_list)

def include_rev(name):
if custom_sql_include is not None and name in custom_sql_include:
return True
if custom_sql_exclude is not None and name in custom_sql_exclude:
return False
if custom_sql_include is not None:
return name in custom_sql_include
if custom_sql_exclude is not None:
return name in custom_sql_exclude
return True


Expand Down Expand Up @@ -368,7 +368,7 @@ def wrapper(self, *args, **kwargs):
# run upgrade(), we capture what's being changed via the dispatcher and see if it's custom sql
rev.module.upgrade()

if (isinstance(last_obj, ops.ExecuteSQL) or isinstance(last_obj, alembicops.ExecuteSQLOp) and include_rev(rev.revision)):
if (isinstance(last_obj, ops.ExecuteSQL) or isinstance(last_obj, alembicops.ExecuteSQLOp)) and include_rev(rev.revision):
custom_sql_buffer.write("-- custom sql for rev %s\n" % rev.revision)
custom_sql_buffer.write(temp_buffer.getvalue())

Expand Down
2 changes: 1 addition & 1 deletion python/auto_schema/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setuptools.setup(
name="auto_schema_test", # auto_schema_test to test
# 0.0.29 production
version="0.0.27", # 0.0.26 was last test version
version="0.0.28", # 0.0.26 was last test version
author="Ola Okelola",
author_email="[email protected]",
description="auto schema for a db",
Expand Down

0 comments on commit 7edf25e

Please sign in to comment.