chore: fix all ruff lint errors + format — 0 errors, 306 tests pass
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import String, ForeignKey, Index, UniqueConstraint
|
||||
from sqlalchemy import Index, String, UniqueConstraint
|
||||
from sqlalchemy.dialects.postgresql import UUID as PGUUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
@@ -17,7 +17,10 @@ class EntityLink(Base, TenantMixin):
|
||||
__tablename__ = "entity_links"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"tenant_id", "file_id", "entity_type", "entity_id",
|
||||
"tenant_id",
|
||||
"file_id",
|
||||
"entity_type",
|
||||
"entity_id",
|
||||
name="uq_entity_links_file_entity",
|
||||
),
|
||||
Index("ix_entity_links_file", "tenant_id", "file_id"),
|
||||
@@ -30,6 +33,4 @@ class EntityLink(Base, TenantMixin):
|
||||
file_id: Mapped[uuid.UUID] = mapped_column(PGUUID(as_uuid=True), nullable=False)
|
||||
entity_type: Mapped[str] = mapped_column(String(20), nullable=False)
|
||||
entity_id: Mapped[uuid.UUID] = mapped_column(PGUUID(as_uuid=True), nullable=False)
|
||||
created_by: Mapped[uuid.UUID | None] = mapped_column(
|
||||
PGUUID(as_uuid=True), nullable=True
|
||||
)
|
||||
created_by: Mapped[uuid.UUID | None] = mapped_column(PGUUID(as_uuid=True), nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user