add fix
This commit is contained in:
parent
426cc1025c
commit
20961fc93a
@ -2,7 +2,7 @@ from datetime import datetime
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from sqlalchemy import ForeignKey
|
from sqlalchemy import ForeignKey, UniqueConstraint
|
||||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||||
|
|
||||||
from src.core.database import Base
|
from src.core.database import Base
|
||||||
@ -31,3 +31,7 @@ class TgMessage(Base):
|
|||||||
user_relationship: Mapped["User"] = relationship(
|
user_relationship: Mapped["User"] = relationship(
|
||||||
backref="message_relationship"
|
backref="message_relationship"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__table_args__ = (
|
||||||
|
UniqueConstraint('chat_id', 'id', name='_chat_id_message_unq'),
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user