Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions airflow/utils/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def check_migration(self):
return True
return False

def _create_db_from_orm(self):
def create_db_from_orm(self):
"""Create database from ORM."""
self.log.info("Creating %s tables from the ORM", self.__class__.__name__)
engine = self.session.get_bind().engine
Expand Down Expand Up @@ -118,7 +118,7 @@ def initdb(self):
if db_exists:
self.upgradedb()
else:
self._create_db_from_orm()
self.create_db_from_orm()

def upgradedb(self, to_revision=None, from_revision=None, show_sql_only=False):
"""Upgrade the database."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class FABDBManager(BaseDBManager):
alembic_file = (PACKAGE_DIR / "alembic.ini").as_posix()
supports_table_dropping = True

def _create_db_from_orm(self):
super()._create_db_from_orm()
def create_db_from_orm(self):
super().create_db_from_orm()
_get_flask_db(settings.SQL_ALCHEMY_CONN).create_all()

def upgradedb(self, to_revision=None, from_revision=None, show_sql_only=False):
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class MockDBManager(BaseDBManager):
class TestBaseDBManager:
@mock.patch.object(BaseDBManager, "get_alembic_config")
@mock.patch.object(BaseDBManager, "get_current_revision")
@mock.patch.object(BaseDBManager, "_create_db_from_orm")
@mock.patch.object(BaseDBManager, "create_db_from_orm")
def test_create_db_from_orm_called_from_init(
self, mock_create_db_from_orm, mock_current_revision, mock_config, session
):
Expand Down