add tenant logic
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from sqlalchemy import Boolean, Column, Integer, String, DateTime,ForeignKey,Table
|
||||
from sqlalchemy.orm import Mapped,relationship,as_declarative,mapped_column
|
||||
from datetime import datetime
|
||||
from app.db.session import Base
|
||||
from app.db import Base
|
||||
from app.core.security import chacha20Decrypt
|
||||
|
||||
@as_declarative()
|
||||
@@ -34,6 +34,7 @@ class User(Base):
|
||||
hashed_password = mapped_column(String(200), nullable=False)
|
||||
is_active = mapped_column(Boolean, default=True)
|
||||
is_superuser = mapped_column(Boolean, default=False)
|
||||
tenantid = mapped_column(String(100))
|
||||
createuserid = mapped_column(Integer,ForeignKey("user.id"))
|
||||
updateuserid = mapped_column(Integer,ForeignKey("user.id"))
|
||||
createuser = relationship('User',foreign_keys=[createuserid])
|
||||
@@ -148,6 +149,7 @@ class Tenant(Base):
|
||||
licence = mapped_column(String(200))
|
||||
startdate = mapped_column(DateTime)
|
||||
enddate = mapped_column(DateTime)
|
||||
db = mapped_column(String(200))
|
||||
|
||||
|
||||
class Domain(Base):
|
||||
|
||||
Reference in New Issue
Block a user