Add latest changes
Dieser Commit ist enthalten in:
@@ -13,31 +13,64 @@ class License(Base):
|
||||
customer_email = Column(String, nullable=False)
|
||||
customer_name = Column(String)
|
||||
|
||||
max_activations = Column(Integer, default=1)
|
||||
device_limit = Column(Integer, default=3)
|
||||
concurrent_sessions_limit = Column(Integer, default=1)
|
||||
is_active = Column(Boolean, default=True)
|
||||
expires_at = Column(DateTime, nullable=True)
|
||||
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
updated_at = Column(DateTime, onupdate=func.now())
|
||||
|
||||
activations = relationship("Activation", back_populates="license")
|
||||
device_registrations = relationship("DeviceRegistration", back_populates="license")
|
||||
sessions = relationship("LicenseSession", back_populates="license")
|
||||
|
||||
class Activation(Base):
|
||||
__tablename__ = "activations"
|
||||
class DeviceRegistration(Base):
|
||||
__tablename__ = "device_registrations"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
license_id = Column(Integer, ForeignKey("licenses.id"))
|
||||
machine_id = Column(String, nullable=False)
|
||||
hardware_hash = Column(String, nullable=False)
|
||||
hardware_fingerprint = Column(String, nullable=False)
|
||||
device_name = Column(String, nullable=False)
|
||||
device_type = Column(String, default="unknown")
|
||||
operating_system = Column(String)
|
||||
|
||||
activation_date = Column(DateTime, server_default=func.now())
|
||||
last_heartbeat = Column(DateTime, server_default=func.now())
|
||||
first_activated_at = Column(DateTime, server_default=func.now())
|
||||
last_seen_at = Column(DateTime, server_default=func.now())
|
||||
is_active = Column(Boolean, default=True)
|
||||
|
||||
os_info = Column(JSON)
|
||||
app_version = Column(String)
|
||||
deactivated_at = Column(DateTime, nullable=True)
|
||||
deactivated_by = Column(String, nullable=True)
|
||||
|
||||
license = relationship("License", back_populates="activations")
|
||||
ip_address = Column(String)
|
||||
user_agent = Column(String)
|
||||
app_version = Column(String)
|
||||
device_metadata = Column("metadata", JSON, default={})
|
||||
|
||||
license = relationship("License", back_populates="device_registrations")
|
||||
sessions = relationship("LicenseSession", back_populates="device_registration")
|
||||
|
||||
|
||||
class LicenseSession(Base):
|
||||
__tablename__ = "license_sessions"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
license_id = Column(Integer, ForeignKey("licenses.id"))
|
||||
device_registration_id = Column(Integer, ForeignKey("device_registrations.id"))
|
||||
|
||||
session_token = Column(String, unique=True, nullable=False)
|
||||
hardware_fingerprint = Column(String, nullable=False)
|
||||
|
||||
started_at = Column(DateTime, server_default=func.now())
|
||||
last_heartbeat = Column(DateTime, server_default=func.now())
|
||||
ended_at = Column(DateTime, nullable=True)
|
||||
end_reason = Column(String, nullable=True)
|
||||
|
||||
ip_address = Column(String)
|
||||
client_version = Column(String)
|
||||
user_agent = Column(String)
|
||||
|
||||
license = relationship("License", back_populates="sessions")
|
||||
device_registration = relationship("DeviceRegistration", back_populates="sessions")
|
||||
|
||||
class Version(Base):
|
||||
__tablename__ = "versions"
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren