feat: add simulation settings and location board redesign
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+10
-2
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
import uuid
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, Numeric, String, Text, Uuid
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Index, Integer, Numeric, String, Text, Uuid
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.extensions import db
|
||||
@@ -22,6 +22,13 @@ class TimestampMixin:
|
||||
)
|
||||
|
||||
|
||||
class SimulationSetting(TimestampMixin, db.Model):
|
||||
__tablename__ = "simulation_settings"
|
||||
|
||||
key: Mapped[str] = mapped_column(String(255), primary_key=True)
|
||||
value: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
|
||||
|
||||
class EngineFamily(TimestampMixin, db.Model):
|
||||
__tablename__ = "engine_families"
|
||||
|
||||
@@ -130,9 +137,10 @@ class VehicleCost(TimestampMixin, db.Model):
|
||||
|
||||
class Asset(TimestampMixin, db.Model):
|
||||
__tablename__ = "assets"
|
||||
__table_args__ = (Index("ix_assets_name", "name"),)
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(Uuid, primary_key=True, default=uuid.uuid4)
|
||||
name: Mapped[str] = mapped_column(String(255), nullable=False, unique=True, index=True)
|
||||
name: Mapped[str] = mapped_column(String(255), nullable=False, unique=True)
|
||||
asset_type: Mapped[str] = mapped_column(String(120), nullable=False, index=True)
|
||||
is_retired: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
program: Mapped[str | None] = mapped_column(String(255))
|
||||
|
||||
Reference in New Issue
Block a user