Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions airflow/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
from airflow import settings
from airflow import models


def include_object(_, name, type_, *args):
"""Filter objects for autogenerating revisions"""
# Ignore _anything_ to do with Flask AppBuilder's tables
if type_ == "table" and name.startswith("ab_"):
return False
else:
return True


# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
Expand Down Expand Up @@ -80,6 +90,7 @@ def run_migrations_online():
transaction_per_migration=True,
target_metadata=target_metadata,
compare_type=COMPARE_TYPE,
include_object=include_object,
)

with context.begin_transaction():
Expand Down