FastAPI backend with auth, user, instance, ticket, query, dashboard APIs. React + TypeScript frontend with mock data UI (10 pages). SQLite + async SQLAlchemy, JWT auth, role-based access control. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
23 lines
1.0 KiB
Python
23 lines
1.0 KiB
Python
from sqlalchemy import Column, Integer, String, Text, DateTime, func
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class Instance(Base):
|
|
__tablename__ = "instances"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(String(100), nullable=False)
|
|
db_type = Column(String(20), nullable=False) # mysql / postgres / redis / mongo
|
|
host = Column(String(200), nullable=False)
|
|
port = Column(Integer, nullable=False)
|
|
username = Column(String(100), nullable=False)
|
|
password = Column(String(500), nullable=False) # encrypted
|
|
database = Column(String(100), nullable=True)
|
|
env = Column(String(20), default="development") # production / staging / development
|
|
description = Column(Text, nullable=True)
|
|
status = Column(String(20), default="disconnected") # connected / disconnected / error
|
|
version = Column(String(50), nullable=True)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|