U ofU @sddlZddlmZddlmZddlmZddlmZddl m Z e j Z e j dk r^ee j dZ dddd Zedd d d Zddd dZddddZe renedS)N) fileConfig)pool) Connection)async_engine_from_config)context)returnc Cs@td}tj|tdddidttW5QRXdS)aFRun migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. zsqlalchemy.urlTZ paramstylenamed)urltarget_metadataZ literal_bindsZ dialect_optsN)configZget_main_optionr configurer begin_transactionrun_migrations)r rI/opt/hc_python/lib/python3.8/site-packages/alembic/templates/async/env.pyrun_migrations_offlines  r) connectionrc Cs.tj|tdttW5QRXdS)N)rr )rr r r r)rrrrdo_run_migrations7s rc s^tttjidtjd}|4IdH}|tIdHW5QIdHRX| IdHdS)zcIn this scenario we need to create an Engine and associate a connection with the context. z sqlalchemy.)prefixZ poolclassN) rr Z get_sectionZconfig_ini_sectionrZNullPoolconnectZrun_syncrZdispose)Z connectablerrrrrun_async_migrations>s  rcCsttdS)z Run migrations in 'online' mode.N)asynciorunrrrrrrun_migrations_onlinePsr)rlogging.configrZ sqlalchemyrZsqlalchemy.enginerZsqlalchemy.ext.asyncioralembicrr Zconfig_file_namer rrrrZis_offline_moderrrrs