초기 커밋
This commit is contained in:
27
app/models/mariadb/system.py
Normal file
27
app/models/mariadb/system.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from sqlmodel import Field, SQLModel
|
||||
|
||||
from app.db.base import TimestampMixin
|
||||
|
||||
|
||||
class SystemConfig(TimestampMixin, SQLModel, table=True):
|
||||
__tablename__ = "system_configs"
|
||||
|
||||
id: int | None = Field(default=None, primary_key=True)
|
||||
key: str = Field(max_length=100, unique=True, index=True)
|
||||
value: str = Field(default="", max_length=2000)
|
||||
description: str = Field(default="", max_length=500)
|
||||
is_secret: bool = Field(default=False)
|
||||
|
||||
|
||||
class AuditLog(TimestampMixin, SQLModel, table=True):
|
||||
__tablename__ = "audit_logs"
|
||||
|
||||
id: int | None = Field(default=None, primary_key=True)
|
||||
user_id: int | None = Field(default=None, foreign_key="users.id")
|
||||
action: str = Field(max_length=100)
|
||||
resource_type: str = Field(max_length=50)
|
||||
resource_id: str = Field(default="", max_length=50)
|
||||
details: str = Field(default="{}", max_length=2000)
|
||||
ip_address: str = Field(default="", max_length=45)
|
||||
Reference in New Issue
Block a user