ephraimbuddy commented on code in PR #24156:
URL: https://github.com/apache/airflow/pull/24156#discussion_r916587060
##########
airflow/utils/db.py:
##########
@@ -655,16 +655,34 @@ def create_default_connections(session: Session =
NEW_SESSION):
@provide_session
def initdb(session: Session = NEW_SESSION):
"""Initialize Airflow database."""
- upgradedb(session=session)
-
+ from alembic import command
+ from flask import Flask
+ from flask_sqlalchemy import SQLAlchemy
+
+ from airflow.models import Base
+ from airflow.www.fab_security.sqla.models import Model
+ from airflow.www.session import AirflowDatabaseSessionInterface
+
+ def _create_flask_session_tbl():
+ flask_app = Flask(__name__)
+ flask_app.config['SQLALCHEMY_DATABASE_URI'] = conf.get('database',
'SQL_ALCHEMY_CONN')
+ db = SQLAlchemy(flask_app)
+ AirflowDatabaseSessionInterface(app=flask_app, db=db, table='session',
key_prefix='')
+ db.create_all()
+
+ Base.metadata.create_all(settings.engine)
Review Comment:
Updated it to have the existing behaviour
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]