Initial Switch to V2. Completely Overhauled Backend, Frontend and General Structure.
This commit is contained in:
26
backend/settings/orm.py
Normal file
26
backend/settings/orm.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from datetime import datetime, timezone
|
||||
from sqlalchemy import Column, DateTime, String, Text
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from database.postgres import Base
|
||||
|
||||
|
||||
def _now():
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
|
||||
class ConsoleSetting(Base):
|
||||
"""Key/value store for console configuration (replaces Firestore 'settings' doc)."""
|
||||
__tablename__ = "console_settings"
|
||||
|
||||
key = Column(String(128), primary_key=True)
|
||||
value = Column(JSONB) # any JSON value
|
||||
updated_at = Column(DateTime(timezone=True), nullable=False, default=_now, onupdate=_now)
|
||||
|
||||
|
||||
class PublicFeature(Base):
|
||||
"""Public-facing feature flags and configuration (replaces Firestore 'public_features' doc)."""
|
||||
__tablename__ = "public_features"
|
||||
|
||||
key = Column(String(128), primary_key=True)
|
||||
value = Column(JSONB)
|
||||
updated_at = Column(DateTime(timezone=True), nullable=False, default=_now, onupdate=_now)
|
||||
Reference in New Issue
Block a user