<s> from __future__ import with_statement <EOL> from alembic import context <EOL> from logging . config import fileConfig <EOL> from airflow import settings <EOL> from airflow import configuration <EOL> from airflow . jobs import models <EOL> config = context . config <EOL> fileConfig ( config . config_file_name ) <EOL> target_metadata = models . Base . metadata <EOL> COMPARE_TYPE = False <EOL> def run_migrations_offline ( ) : <EOL> """<STR_LIT>""" <EOL> url = configuration . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> context . configure ( <EOL> url = url , target_metadata = target_metadata , literal_binds = True , <EOL> compare_type = COMPARE_TYPE ) <EOL> with context . begin_transaction ( ) : <EOL> context . run_migrations ( ) <EOL> def run_migrations_online ( ) : <EOL> """<STR_LIT>""" <EOL> connectable = settings . engine <EOL> with connectable . connect ( ) as connection : <EOL> context . configure ( <EOL> connection = connection , <EOL> target_metadata = target_metadata , <EOL> compare_type = COMPARE_TYPE , <EOL> ) <EOL> with context . begin_transaction ( ) : <EOL> context . run_migrations ( ) <EOL> if context . is_offline_mode ( ) : <EOL> run_migrations_offline ( ) <EOL> else : <EOL> run_migrations_online ( ) </s>
