diff --git a/the_works/models.py b/the_works/models.py index abb8405..59cd9a6 100644 --- a/the_works/models.py +++ b/the_works/models.py @@ -29,7 +29,7 @@ class Genre(Base): __tablename__ = 'Genre' ID: Mapped[int] = mapped_column(primary_key=True) - Genre: Mapped[str] + Genre: Mapped[str] = mapped_column(unique=True) texte: Mapped[List['Text_Genre']] = relationship(back_populates='genre') werke: Mapped[List['Werk_Genre']] = relationship(back_populates='genre') @@ -39,7 +39,7 @@ class Herausgeber(Base): __tablename__ = 'Herausgeber' ID: Mapped[int] = mapped_column(primary_key=True) - Name: Mapped[str] + Name: Mapped[str] = mapped_column(unique=True) werke: Mapped[List['Werk_Herausgeber']] = relationship(back_populates='herausgeber') @@ -48,7 +48,7 @@ class Pseudonym(Base): __tablename__ = 'Pseudonym' ID: Mapped[int] = mapped_column(primary_key=True) - Pseudonym: Mapped[str] + Pseudonym: Mapped[str] = mapped_column(unique=True) veroeffentlichung: Mapped[List['Veroeffentlichung']] = relationship(back_populates='pseudonym') @@ -57,7 +57,7 @@ class Sprache(Base): __tablename__ = 'Sprache' ID: Mapped[int] = mapped_column(primary_key=True) - Sprache: Mapped[str] + Sprache: Mapped[str] = mapped_column(unique=True) text: Mapped[List['Text']] = relationship(back_populates='sprache') @@ -66,7 +66,7 @@ class Textform(Base): __tablename__ = 'Textform' ID: Mapped[int] = mapped_column(primary_key=True) - Textform: Mapped[str] + Textform: Mapped[str] = mapped_column(unique=True) text: Mapped[List['Text']] = relationship(back_populates='textform') @@ -97,7 +97,7 @@ class Verlag(Base): __tablename__ = 'Verlag' ID: Mapped[int] = mapped_column(primary_key=True) - Verlag: Mapped[str] + Verlag: Mapped[str] = mapped_column(unique=True) reihe: Mapped[List['Reihe']] = relationship(back_populates='verlag') werk: Mapped[List['Werk']] = relationship(back_populates='verlag') @@ -107,7 +107,7 @@ class Werksform(Base): __tablename__ = 'Werksform' ID: Mapped[int] = mapped_column(primary_key=True) - Werksform: Mapped[str] + Werksform: Mapped[str] = mapped_column(unique=True) werk: Mapped[List['Werk']] = relationship(back_populates='werksform')