feat: доменный нейминг изменен
This commit is contained in:
@@ -9,12 +9,11 @@ from src import domain
|
||||
if TYPE_CHECKING:
|
||||
from . import TargetChannel
|
||||
|
||||
# M2M association table between TargetChannel and ExternalChannel
|
||||
target_channel_external_channel = Table(
|
||||
'target_channel_external_channels',
|
||||
target_external_channel = Table(
|
||||
'target_external_channel',
|
||||
domain.Base.metadata,
|
||||
Column('target_channel_id', ForeignKey('targetchannels.id', ondelete='CASCADE'), primary_key=True),
|
||||
Column('external_channel_id', ForeignKey('externalchannels.id', ondelete='CASCADE'), primary_key=True),
|
||||
Column('target_channel_id', ForeignKey('target_channel.id', ondelete='CASCADE'), primary_key=True),
|
||||
Column('external_channel_id', ForeignKey('external_channel.id', ondelete='CASCADE'), primary_key=True),
|
||||
)
|
||||
|
||||
|
||||
@@ -24,10 +23,9 @@ class ExternalChannel(domain.Base):
|
||||
username: Mapped[str | None] = mapped_column(index=True)
|
||||
description: Mapped[str | None]
|
||||
subscribers_count: Mapped[int | None]
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(ForeignKey('users.id'), index=True)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(ForeignKey('user.id'), index=True)
|
||||
|
||||
# M2M relationship with target channels
|
||||
target_channels: Mapped[list['TargetChannel']] = relationship(
|
||||
secondary=target_channel_external_channel,
|
||||
secondary=target_external_channel,
|
||||
back_populates='external_channels',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user