27 行
1.0 KiB
Python
27 行
1.0 KiB
Python
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 DestinationDetail(Base):
|
|
__tablename__ = "destination_details"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(String(200), nullable=False)
|
|
slug = Column(String(200), unique=True, nullable=False)
|
|
subtitle = Column(String(500))
|
|
cover_image = Column(String(500))
|
|
description = Column(Text)
|
|
location = Column(String(200))
|
|
best_season = Column(String(200))
|
|
duration = Column(String(100))
|
|
highlights = Column(JSON) # list of {icon, title, description}
|
|
gallery = Column(JSON) # list of image URLs
|
|
tags = Column(JSON) # list of strings
|
|
is_visible = Column(Boolean, default=True)
|
|
sort_order = Column(Integer, default=0)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|