diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
| commit | 47fd81a5910eab3483f79d03eedf9307bc81252f (patch) | |
| tree | 3e1ebd1bddcea649eb968e65161555afd4c2898c /app/models/profile.py | |
| parent | f01cb6703710b7df4c7c022047cd35e1d5e9c70e (diff) | |
simple registration prototype
Diffstat (limited to 'app/models/profile.py')
| -rw-r--r-- | app/models/profile.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/models/profile.py b/app/models/profile.py new file mode 100644 index 0000000..b19d796 --- /dev/null +++ b/app/models/profile.py @@ -0,0 +1,21 @@ +from sqlalchemy import ForeignKey, Integer, String +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column + +Base = DeclarativeBase() + + +class Profile(Base): + __tablename__ = "profiles" + + id: Mapped[int] = mapped_column(Integer, primary_key=True) + user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), unique=True) + + avatar_file: Mapped[str | None] = mapped_column(String(255), nullable=True) + banner_file: Mapped[str | None] = mapped_column(String(255), nullable=True) + description: Mapped[str | None] = mapped_column(String(500), nullable=True) + + publications_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False) + collections_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False) + subscriptions_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False) + followers_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False) + following_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False) |
