backend update 260127
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, Text, Table, Boolean
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, Text, Table, Boolean, DateTime
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from .database import Base
|
||||
@@ -8,8 +8,14 @@ class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
username = Column(String, unique=True, index=True)
|
||||
username = Column(String, index=True)
|
||||
email = Column(String, unique=True, index=True)
|
||||
hashed_password = Column(String)
|
||||
|
||||
tier = Column(String)
|
||||
tier_expires_at = Column(DateTime)
|
||||
last_active_at = Column(DateTime)
|
||||
|
||||
# System keys
|
||||
public_key = Column(String)
|
||||
private_key = Column(String) # Encrypted or raw? Storing raw for now as per req
|
||||
@@ -34,4 +40,14 @@ class Asset(Base):
|
||||
private_key_shard = Column(String)
|
||||
|
||||
author = relationship("User", foreign_keys=[author_id], back_populates="assets")
|
||||
heir = relationship("User", foreign_keys=[heir_id], back_populates="inherited_assets")
|
||||
heir = relationship("User", foreign_keys=[heir_id], back_populates="inherited_assets")
|
||||
|
||||
class AIConfig(Base):
|
||||
__tablename__ = "ai_configs"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
provider_name = Column(String, unique=True, index=True)
|
||||
api_key = Column(String)
|
||||
api_url = Column(String)
|
||||
default_model = Column(String)
|
||||
is_active = Column(Boolean, default=True)
|
||||
Reference in New Issue
Block a user