MCPcopy Create free account
hub / github.com/dataease/SQLBot / run_migrations_online

Function run_migrations_online

backend/alembic/env.py:69–90  ·  view source on GitHub ↗

Run migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context.

()

Source from the content-addressed store, hash-verified

67
68
69def run_migrations_online():
70 """Run migrations in 'online' mode.
71
72 In this scenario we need to create an Engine
73 and associate a connection with the context.
74
75 """
76 configuration = config.get_section(config.config_ini_section)
77 configuration["sqlalchemy.url"] = get_url()
78 connectable = engine_from_config(
79 configuration,
80 prefix="sqlalchemy.",
81 poolclass=pool.NullPool,
82 )
83
84 with connectable.connect() as connection:
85 context.configure(
86 connection=connection, target_metadata=target_metadata, compare_type=True
87 )
88
89 with context.begin_transaction():
90 context.run_migrations()
91
92
93if context.is_offline_mode():

Callers 1

env.pyFile · 0.85

Calls 1

get_urlFunction · 0.85

Tested by

no test coverage detected