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/user.py | |
| parent | f01cb6703710b7df4c7c022047cd35e1d5e9c70e (diff) | |
simple registration prototype
Diffstat (limited to 'app/models/user.py')
| -rw-r--r-- | app/models/user.py | 23 |
1 files changed, 23 insertions, 0 deletions
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) |
