52 lines
2.2 KiB
Python
52 lines
2.2 KiB
Python
from database import SessionLocal, Tour, AgencySetting
|
|
|
|
def seed_db():
|
|
db = SessionLocal()
|
|
|
|
# Check if empty
|
|
if db.query(Tour).count() == 0:
|
|
tours = [
|
|
Tour(
|
|
category="tour",
|
|
title_en="Tikal Mayan Kingdom",
|
|
title_es="Reino Maya de Tikal",
|
|
desc_en="Explore the heart of the Mayan world in the jungles of Petén. Witness towering pyramids and abundant wildlife.",
|
|
desc_es="Explora el corazón del mundo maya en la selva de Petén. Contempla imponentes pirámides y abundante vida silvestre.",
|
|
price="199.00",
|
|
image_url="/static/images/mayan_ruins_tikal.png"
|
|
),
|
|
Tour(
|
|
category="surf",
|
|
title_en="El Paredón Surf Experience",
|
|
title_es="Experiencia de Surf en El Paredón",
|
|
desc_en="Catch the best waves in Central America on volcanic black sand beaches. Perfect for all skill levels.",
|
|
desc_es="Atrapa las mejores olas de Centroamérica en playas de arena negra volcánica. Perfecto para todos los niveles.",
|
|
price="85.00",
|
|
image_url="/static/images/surf_el_paredon.png"
|
|
),
|
|
Tour(
|
|
category="volcano",
|
|
title_en="Acatenango & Fuego Overnight",
|
|
title_es="Acatenango y Fuego (2 Días)",
|
|
desc_en="Hike up Acatenango to witness the spectacular eruptions of Volcán de Fuego under the stars.",
|
|
desc_es="Sube al Acatenango para presenciar las espectaculares erupciones del Volcán de Fuego bajo las estrellas.",
|
|
price="120.00",
|
|
image_url="/static/images/volcano_fuego.png"
|
|
)
|
|
]
|
|
db.add_all(tours)
|
|
|
|
# Add basic agency settings
|
|
settings = [
|
|
AgencySetting(setting_key="agency_name", setting_value="GTravel"),
|
|
AgencySetting(setting_key="agency_email", setting_value="info@gtravel.com"),
|
|
]
|
|
db.add_all(settings)
|
|
|
|
db.commit()
|
|
db.close()
|
|
|
|
if __name__ == "__main__":
|
|
seed_db()
|
|
print("Database seeded!")
|