sqlite-support
Some checks failed
Deploy on push / deploy (push) Failing after 9s

This commit is contained in:
2024-10-14 02:05:20 +03:00
parent 5c40ab3d00
commit 7c86d95f5e
6 changed files with 74 additions and 53 deletions

View File

@@ -2,11 +2,10 @@ import time
from enum import Enum as Enumeration
from sqlalchemy import JSON, Column, ForeignKey, Integer, String
from sqlalchemy.exc import ProgrammingError
from sqlalchemy.orm import relationship
from orm.author import Author
from services.db import Base, engine
from services.db import Base, create_table_if_not_exists, engine
from utils.logger import root_logger as logger
@@ -42,10 +41,5 @@ class Notification(Base):
seen = relationship(lambda: Author, secondary="notification_seen")
try:
Notification.__table__.create(engine)
logger.info("Table `notification` was created.")
except ProgrammingError:
# Handle the exception here, for example by printing a message
logger.info("Table `notification` already exists.")
# Вызываем функцию создания таблицы
create_table_if_not_exists(engine, Notification)