16 lines
466 B
Python
16 lines
466 B
Python
from sqlalchemy import BIGINT, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from . import Base
|
|
|
|
|
|
class User (Base):
|
|
__tablename__ = "user"
|
|
|
|
id: Mapped[int] = mapped_column(BIGINT, primary_key=True, unique=True, autoincrement=False)
|
|
username: Mapped[str] = mapped_column(String(32), unique=True, nullable=True)
|
|
# additional fields go here
|
|
|
|
def __init__(self, id: int, username: str):
|
|
super().__init__(id=id, username=username)
|