diff --git a/api/v1/models/__init__.py b/api/v1/models/__init__.py index 42bc1be..dac08db 100644 --- a/api/v1/models/__init__.py +++ b/api/v1/models/__init__.py @@ -6,3 +6,4 @@ from api.v1.models.profile_picture import ProfilePicture from api.v1.models.social_link import SocialLink from api.v1.models.notification import Notification +from api.v1.models.hashtag import Hashtag diff --git a/api/v1/models/hashtag.py b/api/v1/models/hashtag.py new file mode 100644 index 0000000..2b260dc --- /dev/null +++ b/api/v1/models/hashtag.py @@ -0,0 +1,14 @@ +from sqlalchemy.orm import mapped_column, Mapped +from sqlalchemy import Integer, String + +from api.v1.models.abstract_base import AbstractBaseModel + + +class Hashtag(AbstractBaseModel): + __tablename__ = "hashtag" + + tag: Mapped[str] = mapped_column(String(55), nullable=False, unique=True) + usage: Mapped[int] = mapped_column(Integer, default=1) + + def __str__(self): + return self.tag