Skip to content

Commit 7e8a4b5

Browse files
feat(dev): add SQL seed file and db tasks for development
- Add scripts/dev_seed.sql with sample restaurant data - Add task db:seed to populate development database - Add task db:reset to delete database for fresh start Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fb55f74 commit 7e8a4b5

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

scripts/dev_seed.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- * Development seed data for LunchJS
2+
-- * Usage: sqlite3 ~/Library/Application\ Support/Lunch/lunch.db < scripts/dev_seed.sql
3+
-- * Or via task: task db:seed
4+
5+
-- Clear existing data (optional - comment out to append instead)
6+
DELETE FROM lunch_list;
7+
DELETE FROM recent_lunch;
8+
9+
-- Seed restaurants
10+
INSERT OR IGNORE INTO lunch_list (restaurants, option) VALUES
11+
('Arbys', 'cheap'),
12+
('Bubba''s', 'normal'),
13+
('Charlestons', 'normal'),
14+
('Firehouse', 'normal'),
15+
('Freddies', 'normal'),
16+
('Frosted Mug', 'normal'),
17+
('Hideaway', 'normal'),
18+
('Jersey Mike''s', 'normal'),
19+
('Johnnies', 'normal'),
20+
('Mcalisters', 'normal'),
21+
('Mcneilies', 'normal'),
22+
('Olive Garden', 'normal'),
23+
('On The Border', 'normal'),
24+
('Qdoba', 'normal'),
25+
('Tamashii Ramen', 'normal'),
26+
('Teds', 'normal'),
27+
('The Mule', 'normal'),
28+
('Zios', 'normal');

taskfile.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,15 @@ tasks:
120120
dir: src-tauri/dist
121121
cmds:
122122
- npm run test:e2e:ui
123+
124+
db:seed:
125+
desc: "Seed development database with sample restaurants"
126+
cmds:
127+
- sqlite3 ~/Library/Application\ Support/Lunch/lunch.db < scripts/dev_seed.sql
128+
- echo "Database seeded successfully"
129+
130+
db:reset:
131+
desc: "Reset development database (delete and recreate)"
132+
cmds:
133+
- rm -f ~/Library/Application\ Support/Lunch/lunch.db
134+
- echo "Database deleted. Run 'task dev' to recreate, then 'task db:seed' to seed."

0 commit comments

Comments
 (0)