Files
New-planet-api/new-planet-backend/app/db/base.py
FDKost e04933b9c1 Refactored:
- пофикшен баг с авторизацией;
- поменен README.md, более подробно описан запуск проекта;
- починен .env для проекта.
Checked:
- docker-compose работает;
- auth работает;
- чат с нейросетью работает, но кидает 400 из за NEWPLANET-AI-AGENTS,нужно настроить подключение.
2025-12-18 14:14:04 +03:00

30 lines
675 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, DateTime, func, String
import uuid
Base = declarative_base()
class BaseModel(Base):
"""Базовая модель с общими полями"""
__abstract__ = True
id = Column(
String,
primary_key=True,
default=lambda: str(uuid.uuid4()),
nullable=False
)
created_at = Column(
DateTime(timezone=True),
server_default=func.now(),
nullable=False
)
updated_at = Column(
DateTime(timezone=True),
server_default=func.now(),
onupdate=func.now(),
nullable=False
)