3 services are updated

This commit is contained in:
2025-05-13 18:29:02 +03:00
parent cd62d96158
commit 6dfa17c5e6
54 changed files with 1374 additions and 148 deletions

View File

@@ -0,0 +1,23 @@
import os
from sqlalchemy import text
def generate_alembic(session):
try:
result = session.execute(
text(
"SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = "
"'alembic_version') AS table_existence;"
)
)
if result.first()[0]:
session.execute(text("delete from alembic_version;"))
session.commit()
except Exception as e:
print(e)
finally:
run_command = "python -m alembic stamp head;"
run_command += (
"python -m alembic revision --autogenerate;python -m alembic upgrade head;"
)
os.system(run_command)