Public
LikeRecipes
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v37View latest version
This directory contains database schema and query modules for the meals app.
- migrations.ts - Schema definitions and table creation
- queries.ts - CRUD operations for recipes, ingredients, and instructions
Stores recipe metadata including title, source URL, servings, and timing.
Stores recipe ingredients with quantity, unit, and notes. Linked to recipes via recipe_id.
Stores recipe steps in order. Linked to recipes via recipe_id.
Migrations run automatically on backend startup via runMigrations(). The function uses CREATE TABLE IF NOT EXISTS so it's safe to call multiple times.
To modify a schema, create a new table version (e.g., recipes_v2) rather than using ALTER TABLE, which has limited support in Val Town's SQLite.