#!/bin/zsh

# Clear today's verse from daily_verses table
DB_PATH="dev.db"
TODAY=$(date +%Y-%m-%d)

echo "Deleting verse for date: $TODAY"

sqlite3 "$DB_PATH" "DELETE FROM daily_verses WHERE date = '$TODAY';"

if [ $? -eq 0 ]; then
    echo "✓ Successfully deleted verse for $TODAY"

    # Show remaining verses in table
    COUNT=$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM daily_verses;")
    echo "Remaining verses in database: $COUNT"
else
    echo "✗ Failed to delete verse"
    exit 1
fi
