From 47fd81a5910eab3483f79d03eedf9307bc81252f Mon Sep 17 00:00:00 2001 From: l3wdfut4pwr Date: Tue, 17 Mar 2026 14:11:45 +0200 Subject: simple registration prototype --- app/models/profile.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/models/profile.py (limited to 'app/models/profile.py') 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) -- cgit v1.3-3-g829e