Initial Commit. Split cloud service from the combined project
This commit is contained in:
21
cloud_backend/models/site.py
Normal file
21
cloud_backend/models/site.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
||||
from sqlalchemy.sql import func
|
||||
from database import Base
|
||||
|
||||
|
||||
class Site(Base):
|
||||
__tablename__ = "sites"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
site_id = Column(String, unique=True, nullable=False, index=True)
|
||||
name = Column(String, nullable=False)
|
||||
owner_name = Column(String, nullable=False)
|
||||
contact_email = Column(String, nullable=False)
|
||||
secret_key_hash = Column(String, nullable=False)
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_locked = Column(Boolean, default=False)
|
||||
lock_reason = Column(String, nullable=True)
|
||||
license_expires_at = Column(DateTime(timezone=True), nullable=False)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
last_seen_at = Column(DateTime(timezone=True), nullable=True)
|
||||
last_seen_ip = Column(String, nullable=True)
|
||||
Reference in New Issue
Block a user