51 行
1.6 KiB
Python
51 行
1.6 KiB
Python
"""Destination comparison (目的地对比) data model."""
|
|
from __future__ import annotations
|
|
from sqlalchemy import Column, Integer, String, Text, Boolean, DateTime, JSON
|
|
from sqlalchemy.sql import func
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class DestinationConfig(Base):
|
|
__tablename__ = "destination_config"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
title = Column(String(200))
|
|
subtitle = Column(String(200))
|
|
intro = Column(Text)
|
|
closing_title = Column(String(200))
|
|
closing_text = Column(Text)
|
|
data_sources = Column(Text)
|
|
honest_title = Column(String(200))
|
|
honest_subtitle = Column(String(200))
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
|
|
|
|
|
class DestinationItem(Base):
|
|
__tablename__ = "destination_items"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
dest_id = Column(String(50), nullable=False)
|
|
name = Column(String(100), nullable=False)
|
|
tag = Column(String(200))
|
|
highlight = Column(Boolean, default=False)
|
|
sort_order = Column(Integer, default=0)
|
|
|
|
|
|
class DestinationDimension(Base):
|
|
__tablename__ = "destination_dimensions"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
label = Column(String(100), nullable=False)
|
|
icon = Column(String(10))
|
|
values = Column(JSON) # list of 3 strings, one per destination
|
|
sort_order = Column(Integer, default=0)
|
|
|
|
|
|
class DestinationHonestItem(Base):
|
|
__tablename__ = "destination_honest_items"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
text = Column(Text, nullable=False)
|
|
sort_order = Column(Integer, default=0)
|