Potion/internal/infrastructure/database/migrations/008_create_favorites_table.sql
Hayden Hargreaves bebeb25492 (DB/FEAT): Implemented toggle favorite in the backend.
The frontend is half wired up, just need to update the button. I also
want to update the recipe methods to return the favorite status. This
will follow very similar to the way I updated the tags. Another method
which can be called to attach the favorite state.
2025-07-14 21:30:45 -07:00

15 lines
358 B
PL/PgSQL

-- Author: Hayden Hargreaves (hhargreaves2006@gmail.com)
-- Desc: Create the favorites table.
-- Date: 07/14/2025
BEGIN;
CREATE TABLE IF NOT EXISTS Favorites (
Id SERIAL PRIMARY KEY NOT NULL,
UserId INTEGER NOT NULL REFERENCES users(id),
RecipeId INTEGER NOT NULL REFERENCES recipes(id),
Created TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
COMMIT;