diff --git a/depicts/model.py b/depicts/model.py index 6d7a51b..12e4fc0 100644 --- a/depicts/model.py +++ b/depicts/model.py @@ -1,7 +1,7 @@ from sqlalchemy.ext.declarative import declarative_base from .database import session, now_utc from sqlalchemy.schema import Column, ForeignKey -from sqlalchemy.types import Integer, String, DateTime +from sqlalchemy.types import Integer, String, DateTime, Boolean from sqlalchemy.orm import column_property, relationship, synonym from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.sql.expression import cast @@ -11,6 +11,14 @@ from urllib.parse import quote Base = declarative_base() Base.query = session.query_property() +class User(Base): + __tablename__ = 'user' + id = Column(Integer, primary_key=True, autoincrement=False) + username = Column(String, unique=True) + options = Column(postgresql.JSON) + first_seen = Column(DateTime, default=now_utc()) + is_admin = Column(Boolean, default=False) + class DepictsItem(Base): __tablename__ = 'depicts' item_id = Column(Integer, primary_key=True, autoincrement=False)