Atualizar app/models.py
This commit is contained in:
+11
-6
@@ -1,8 +1,9 @@
|
||||
from sqlalchemy import Column, String, Text, DateTime, ForeignKey
|
||||
from sqlalchemy import Column, String, Text, DateTime, ForeignKey, Boolean, Integer
|
||||
from sqlalchemy.orm import declarative_base, relationship
|
||||
from datetime import datetime
|
||||
|
||||
Base = declarative_base()
|
||||
#Base = declarative_base()
|
||||
from db import Base
|
||||
|
||||
class Conversation(Base):
|
||||
__tablename__ = "conversations"
|
||||
@@ -34,10 +35,6 @@ class Attachment(Base):
|
||||
|
||||
# ***
|
||||
|
||||
from sqlalchemy import Column, String, Boolean, Text, DateTime, Integer
|
||||
from datetime import datetime
|
||||
from db import Base
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
id = Column(String, primary_key=True)
|
||||
@@ -47,6 +44,14 @@ class User(Base):
|
||||
twofa_method = Column(String, default="totp")
|
||||
twofa_secret = Column(String)
|
||||
twofa_sensitive_actions = Column(Boolean, default=False)
|
||||
email = Column(String, primary_key=True)
|
||||
role = Column(String, default="user") # "user", "admin"
|
||||
can_use_audio = Column(Boolean, default=False)
|
||||
can_use_vision = Column(Boolean, default=False)
|
||||
can_share = Column(Boolean, default=True)
|
||||
|
||||
|
||||
|
||||
|
||||
class Preferences(Base):
|
||||
__tablename__ = "preferences"
|
||||
|
||||
Reference in New Issue
Block a user