Features: - Toast notifications system (replaces alerts/confirms) - Shift+click range selection for blocking dates - Ctrl/Cmd+click for non-contiguous multi-date selection - Progress indicators for all async operations - Improved blocked dates list with formatted dates - Red styling for blocked dates in calendar - Blue styling for pending dates (Ctrl+click) - Weekly schedule awareness (confirm before blocking work days) - Non-working day styling (gray, dashed border) Other improvements: - Featured flag for menus (DB migration script included) - Image handling fixes (renamed PNG files, updated references) - Optimistic UI updates for better UX - Multi-select bulk delete for blocked dates - Show-only-blocked filter mode Components: - src/components/ui/toast.tsx (new) - scripts/add-featured-column.mjs (new DB migration) - scripts/README.md (migration documentation)
1.4 KiB
1.4 KiB
Run database migrations in this repo
This repository includes a small, idempotent migration to add a featured column to the menus table.
Script
scripts/add-featured-column.mjs— checks information_schema and addsfeatured TINYINT(1) NOT NULL DEFAULT 0if missing.
How to run
From the project root, set your DB connection environment variables and run the script. Example (zsh):
export DB_HOST=localhost
export DB_USER=root
export DB_PASSWORD='your-password'
export DB_NAME=warme
# run the migration
node scripts/add-featured-column.mjs
If the script can't connect, confirm your environment variables and that the MySQL/MariaDB server is reachable from this machine.
SQL alternative
If you prefer to run SQL directly in your DB client, run:
SELECT COUNT(*) AS cnt
FROM information_schema.columns
WHERE table_schema = 'your_db_name' AND table_name = 'menus' AND column_name = 'featured';
-- If cnt = 0
ALTER TABLE menus ADD COLUMN featured TINYINT(1) NOT NULL DEFAULT 0;
UPDATE menus SET featured = 0 WHERE featured IS NULL;
Verification
After running, check with:
mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASSWORD" -D "$DB_NAME" -e "DESCRIBE menus;"
Notes
- The migration is idempotent — running it multiple times is safe.
- I can't run it from CI/this environment without database credentials. Run it locally on your machine or on a host that can reach the DB.