Skip to content

Commit

Permalink
woop
Browse files Browse the repository at this point in the history
  • Loading branch information
Erutis committed Sep 6, 2024
1 parent e1fbc22 commit c9796f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ script_location = ./migrations
# Uncomment the line below if you want the files to be prepended with date and time
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
# for all available tokens
file_template = %%(year)d_%%(month).2d_%%(day).2d-%%(rev)s
file_template = %%(slug)s

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
Expand Down
10 changes: 10 additions & 0 deletions migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def run_migrations_online() -> None:
target_metadata=target_metadata,
process_revision_directives=process_revision_directives, # Make sure geoalchemy import included with any autogen script
include_object=include_object,
dialect_opts={"paramstyle": "named"},
include_schemas=True,
include_name=include_name,
)

for schema in SCHEMATA:
Expand All @@ -110,6 +113,13 @@ def run_migrations_online() -> None:
context.run_migrations()


def include_name(name, type_, parent_names):
if type_ == "schema":
return name in SCHEMATA
else:
return True


if context.is_offline_mode():
run_migrations_offline()
else:
Expand Down

0 comments on commit c9796f7

Please sign in to comment.