Created
January 5, 2024 20:22
-
-
Save colonelpanic8/6e194cf8220af37475565eb7ea96d346 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TagClass(Base): | |
| __tablename__ = "tag_class_join" | |
| id = sa.Column(sa.BIGINT, primary_key=True) | |
| tag_id = sa.Column( | |
| sa.BIGINT, | |
| sa.ForeignKey("tag.id", onupdate="CASCADE", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| class TagClassJoin(Base): | |
| __tablename__ = "tag_class_join" | |
| id = sa.Column(sa.BIGINT, primary_key=True) | |
| tag_id = sa.Column( | |
| sa.BIGINT, | |
| sa.ForeignKey("tag.id", onupdate="CASCADE", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| tag_class_id = sa.Column( | |
| sa.BIGINT, | |
| sa.ForeignKey("tag.id", onupdate="CASCADE", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| class Tag(Base): | |
| __tablename__ = "tag" | |
| id = sa.Column(sa.BIGINT, primary_key=True) | |
| # or maybe just have a foreign key into tag class | |
| class VideoTag(Base): | |
| __tablename__ = "video_tag" | |
| id = sa.Column(sa.BIGINT, primary_key=True) | |
| tag_id = sa.Column( | |
| sa.BIGINT, | |
| sa.ForeignKey("tag.id", onupdate="CASCADE", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| video_id = sa.Column( | |
| sa.BIGINT, | |
| sa.ForeignKey("video.id", onupdate="CASCADE", ondelete="CASCADE"), | |
| nullable=False, | |
| unique=True, | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment