-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
21 lines (17 loc) · 839 Bytes
/
Copy pathmodels.py
File metadata and controls
21 lines (17 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from database import Base
from sqlalchemy.sql.sqltypes import TIMESTAMP
from sqlalchemy.sql.expression import text
from sqlalchemy import Column, Integer, String, Boolean
class Memory(Base):
__tablename__ = "memory"
id = Column(Integer, primary_key=True, nullable=False)
listen = Column(String, nullable=False)
reply = Column(String, nullable=False)
Author = Column(String, nullable=False)
published = Column(Boolean, server_default='FALSE', nullable=False)
created = Column(TIMESTAMP(timezone=True), server_default=text('now()'), nullable=False)
class Users(Base):
__tablename__ = "users"
chat_id = Column(String, nullable=False, unique=True, primary_key=True)
trust = Column(Integer, nullable=False)
created = Column(TIMESTAMP(timezone=True), server_default=text('now()'), nullable=False)