uhhh
This commit is contained in:
1 parent
e16a193cb7
commit
796e9d2bd8
3 files changed
+23
-15
No files matched your search
+1
-2
@@ -24,6 +24,7 @@ class Attachment(Base):
|
||||
# can be multiple attachments on a msg
|
||||
# so we make our own ids for attachments
|
||||
id: Mapped[UUID] = mapped_column(primary_key=True)
|
||||
attachment_id: Mapped[int] = mapped_column(BigInteger, nullable=False, unique=True)
|
||||
msg_id: Mapped[int] = mapped_column(BigInteger, nullable=False, index=True)
|
||||
|
||||
url: Mapped[str]
|
||||
@@ -33,8 +34,6 @@ class Attachment(Base):
|
||||
channel: Mapped[dict[str, Any]]
|
||||
vision: Mapped[Optional[dict[str, Any]]] = mapped_column(default=None)
|
||||
|
||||
__table_args__ = (UniqueConstraint('msg_id', 'url', name='ix_attachments_msg_id_url_uc'),)
|
||||
|
||||
def file_details(self) -> tuple[str, str]:
|
||||
u = urlparse(self.url)
|
||||
if not u.path:
|
||||
|
||||
Reference in new issue
Block a user