Compare commits
No commits in common. "1d0464c21915ee6d48be316f80172427013e6385" and "bf2f52da815184f7be2513353ee53dae1ba8962b" have entirely different histories.
1d0464c219
...
bf2f52da81
3 changed files with 4 additions and 71 deletions
|
|
@ -38,9 +38,3 @@ app.include_router(stats.router)
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
def read_root():
|
def read_root():
|
||||||
return {"Hello": "World"}
|
return {"Hello": "World"}
|
||||||
|
|
||||||
@app.get("/healthz")
|
|
||||||
def health_check():
|
|
||||||
"""Health check endpoint for monitoring and load balancers"""
|
|
||||||
return {"status": "healthy"}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
"""
|
|
||||||
Seed script to create demo ratings for shows and performances.
|
|
||||||
Run with: python seed_ratings.py
|
|
||||||
"""
|
|
||||||
from sqlmodel import Session, create_engine, select
|
|
||||||
from database import DATABASE_URL
|
|
||||||
from models import Rating, Show, Performance, User
|
|
||||||
import random
|
|
||||||
|
|
||||||
def seed_ratings():
|
|
||||||
engine = create_engine(DATABASE_URL)
|
|
||||||
|
|
||||||
with Session(engine) as session:
|
|
||||||
# Get first user (or admin) to attribute ratings to
|
|
||||||
user = session.exec(select(User).limit(1)).first()
|
|
||||||
if not user:
|
|
||||||
print("No users found. Please create a user first.")
|
|
||||||
return
|
|
||||||
|
|
||||||
# Get some shows
|
|
||||||
shows = session.exec(select(Show).limit(20)).all()
|
|
||||||
# Get some performances
|
|
||||||
performances = session.exec(select(Performance).limit(50)).all()
|
|
||||||
|
|
||||||
created_count = 0
|
|
||||||
|
|
||||||
# Seed show ratings (7-10 range for positive feel)
|
|
||||||
for show in shows:
|
|
||||||
# Check if rating already exists
|
|
||||||
existing = session.exec(
|
|
||||||
select(Rating).where(Rating.show_id == show.id, Rating.user_id == user.id)
|
|
||||||
).first()
|
|
||||||
if existing:
|
|
||||||
continue
|
|
||||||
|
|
||||||
rating = Rating(
|
|
||||||
user_id=user.id,
|
|
||||||
show_id=show.id,
|
|
||||||
score=random.randint(7, 10)
|
|
||||||
)
|
|
||||||
session.add(rating)
|
|
||||||
created_count += 1
|
|
||||||
|
|
||||||
# Seed performance ratings
|
|
||||||
for perf in performances:
|
|
||||||
existing = session.exec(
|
|
||||||
select(Rating).where(Rating.performance_id == perf.id, Rating.user_id == user.id)
|
|
||||||
).first()
|
|
||||||
if existing:
|
|
||||||
continue
|
|
||||||
|
|
||||||
rating = Rating(
|
|
||||||
user_id=user.id,
|
|
||||||
performance_id=perf.id,
|
|
||||||
score=random.randint(6, 10)
|
|
||||||
)
|
|
||||||
session.add(rating)
|
|
||||||
created_count += 1
|
|
||||||
|
|
||||||
session.commit()
|
|
||||||
print(f"Created {created_count} demo ratings!")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
seed_ratings()
|
|
||||||
|
|
@ -48,7 +48,10 @@ export function Navbar() {
|
||||||
<Link href="/tours">
|
<Link href="/tours">
|
||||||
<DropdownMenuItem>Tours</DropdownMenuItem>
|
<DropdownMenuItem>Tours</DropdownMenuItem>
|
||||||
</Link>
|
</Link>
|
||||||
{/* Leaderboards hidden until community activity grows */}
|
<DropdownMenuSeparator />
|
||||||
|
<Link href="/leaderboards">
|
||||||
|
<DropdownMenuItem>Leaderboards</DropdownMenuItem>
|
||||||
|
</Link>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue