Files
sustenance/migrations/20240102000000_meal_categories.sql
T
sbstp 3695fc68d6
ci/woodpecker/push/e2e Pipeline was successful
ci/woodpecker/push/fmt Pipeline failed
ci/woodpecker/push/test Pipeline was successful
meal categories
2026-08-03 21:29:33 -04:00

11 lines
352 B
SQL

CREATE TABLE meal_categories (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE COLLATE NOCASE,
position INTEGER NOT NULL DEFAULT 0,
created_at INTEGER NOT NULL
);
ALTER TABLE meals ADD COLUMN category_id INTEGER REFERENCES meal_categories(id) ON DELETE SET NULL;
CREATE INDEX meals_category_idx ON meals(category_id);