Make sure room names are unique

This commit is contained in:
2024-09-25 13:13:18 +02:00
parent 9dec492b2f
commit 83857507ea
4 changed files with 74 additions and 23 deletions

View File

@@ -1,11 +1,9 @@
from logging.config import fileConfig
from reflector.settings import settings
from reflector.db import metadata
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from reflector.db import metadata
from reflector.settings import settings
from sqlalchemy import engine_from_config, pool
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
@@ -45,6 +43,7 @@ def run_migrations_offline() -> None:
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
render_as_batch=True,
)
with context.begin_transaction():
@@ -67,7 +66,9 @@ def run_migrations_online() -> None:
)
with connectable.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata)
context.configure(
connection=connection, target_metadata=target_metadata, render_as_batch=True
)
with context.begin_transaction():
context.run_migrations()