pnut-matrix/models.py

33 lines
983 B
Python
Raw Normal View History

2019-01-04 03:49:38 +00:00
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from database import Base
class Avatars(Base):
__tablename__ = 'avatars'
id = Column(Integer, primary_key=True)
pnut_user = Column(String(250), unique=True)
avatar = Column(String(250))
class Rooms(Base):
__tablename__ = 'rooms'
id = Column(Integer, primary_key=True)
room_id = Column(String(250), unique=True)
pnut_chan = Column(Integer, unique=True)
portal = Column(Boolean)
class Events(Base):
__tablename__ = 'events'
id = Column(Integer, primary_key=True)
event_id = Column(String(250))
room_id = Column(String(250))
pnut_msg_id = Column(Integer)
pnut_user_id = Column(Integer)
pnut_chan_id = Column(Integer)
deleted = Column(Boolean)
class Users(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
matrix_id = Column(String(250))
pnut_user_id = Column(Integer)
pnut_user_token = Column(String(250))