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/user.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/models/user.py (limited to 'app/models/user.py') diff --git a/app/models/user.py b/app/models/user.py new file mode 100644 index 0000000..de9fa98 --- /dev/null +++ b/app/models/user.py @@ -0,0 +1,23 @@ +from sqlalchemy import Boolean, Integer, String +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column + + +class Base(DeclarativeBase): + pass + + +class User(Base): + __tablename__ = "users" + + id: Mapped[int] = mapped_column(Integer, primary_key=True) + username: Mapped[str] = mapped_column(String(20), unique=True, nullable=False) + password: Mapped[str | None] = mapped_column(String(255), nullable=True) + email: Mapped[str | None] = mapped_column(String(120), unique=True, nullable=True) + google_id: Mapped[str | None] = mapped_column( + String(255), unique=True, nullable=True + ) + avatar_file: Mapped[str | None] = mapped_column(String(255), nullable=True) + banner_file: Mapped[str | None] = mapped_column(String(255), nullable=True) + premium: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False) + is_banned: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False) + is_moderator: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False) -- cgit v1.3-3-g829e