Skip to content

Fix: Add productos table for Exercise #28#3

Merged
camilocbarrera merged 9 commits intomainfrom
fix/exercise-28-productos-table
Jan 4, 2026
Merged

Fix: Add productos table for Exercise #28#3
camilocbarrera merged 9 commits intomainfrom
fix/exercise-28-productos-table

Conversation

@camilocbarrera
Copy link
Member

Summary

Fixes #2 - Exercise #28 "Múltiples JOINs" was failing because the productos table didn't exist.

Changes

Bug Fix

  • Added productos table with columns: id, nombre, precio, categoria
  • Added producto_id foreign key to pedidos table
  • Inserted 8 sample products across categories
  • Updated all 14 pedidos records with producto_id references

Testing Infrastructure

  • Added Vitest testing framework with 127 passing tests
  • Schema consistency tests validate all table/column references
  • Sample solution tests verify exercises are solvable
  • Test fixtures provide SQL solutions for all 50 exercises

CI/CD

  • Added GitHub Actions workflow for pre-merge validation
  • Runs lint → test → build on every PR

Test Results

✓ 127 tests passing
  - 71 schema consistency tests
  - 56 solution validation tests

cc @frankyemm

- Add productos table with id, nombre, precio, categoria columns
- Add producto_id foreign key to pedidos table
- Insert 8 sample products across categories
- Update pedidos records with producto_id references

Fixes #2
- Install vitest dependency
- Add test and test:watch npm scripts
- Configure vitest with node environment and path aliases
- Add db-schema.ts with table/column definitions
- Add sample-solutions.ts with 50 SQL solutions for all exercises
- Add schema consistency tests (71 tests)
- Add solution execution tests (56 tests)
- Validate table/column references exist in DB schema
- Verify sample solutions execute successfully against PGlite
- Run lint, test, and build on PRs and pushes to main
- Use Bun for fast dependency installation
- Block merging if any step fails
- Convert single quotes to double quotes
- Add semicolons to statements
- Organize imports alphabetically
- Apply consistent formatting across all files
@vercel
Copy link

vercel bot commented Jan 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sql4all Ready Ready Preview, Comment Jan 4, 2026 11:35am

- Use node: protocol for fs and path imports
- Replace non-null assertion with nullish coalescing
- Add type='button' to prevent form submission
- Use unique keys instead of array indices
- Remove unused imports
- Fix async Promise executor pattern
- Update biome config for project-specific rules
- Add type='button' to prevent form submission
- Exclude CSS files from biome (Tailwind syntax)
- Build requires valid Clerk keys and database connection
- Vercel deployment already handles production builds
- CI now focuses on lint and test for code quality
Copy link

@frankyemm frankyemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 78-84 you create the product tables, 88 you add the fk in pedidos and 109-118 you insert products mockup, nice job

@camilocbarrera
Copy link
Member Author

Merged! thanks for the feedback!

@camilocbarrera camilocbarrera merged commit ee83eb6 into main Jan 4, 2026
3 checks passed
@camilocbarrera camilocbarrera deleted the fix/exercise-28-productos-table branch January 4, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Exercise #28 of 50

2 participants