Revision 2715ade4 snf-pithos-backend/pithos/backends/lib/sqlalchemy/alembic/env.py
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/alembic/env.py | ||
---|---|---|
36 | 36 |
db = config.get_main_option("sqlalchemy.url", PITHOS_BACKEND_DB_CONNECTION) |
37 | 37 |
config.set_main_option("sqlalchemy.url", db) |
38 | 38 |
|
39 |
|
|
39 | 40 |
def run_migrations_offline(): |
40 | 41 |
"""Run migrations in 'offline' mode. |
41 | 42 |
|
... | ... | |
54 | 55 |
with context.begin_transaction(): |
55 | 56 |
context.run_migrations() |
56 | 57 |
|
58 |
|
|
57 | 59 |
def run_migrations_online(): |
58 | 60 |
"""Run migrations in 'online' mode. |
59 | 61 |
|
... | ... | |
62 | 64 |
|
63 | 65 |
""" |
64 | 66 |
engine = engine_from_config( |
65 |
config.get_section(config.config_ini_section),
|
|
66 |
prefix='sqlalchemy.',
|
|
67 |
poolclass=pool.NullPool)
|
|
67 |
config.get_section(config.config_ini_section), |
|
68 |
prefix='sqlalchemy.', |
|
69 |
poolclass=pool.NullPool) |
|
68 | 70 |
|
69 | 71 |
connection = engine.connect() |
70 | 72 |
context.configure( |
71 |
connection=connection,
|
|
72 |
target_metadata=target_metadata
|
|
73 |
)
|
|
73 |
connection=connection, |
|
74 |
target_metadata=target_metadata |
|
75 |
) |
|
74 | 76 |
|
75 | 77 |
try: |
76 | 78 |
with context.begin_transaction(): |
... | ... | |
82 | 84 |
run_migrations_offline() |
83 | 85 |
else: |
84 | 86 |
run_migrations_online() |
85 |
|
Also available in: Unified diff