Skip to main content

Entity Relationships

profiles (1) ──< recipes (many)
profiles (1) ──< posts (many)
profiles (1) ──< collections (many)
recipes (1) ──< recipe_images (many)
recipes (1) ──< recipe_tags (many)
recipes (1) ──< lightroom_settings (1)
posts (1) ──< post_images (many)
posts (1) ──< post_tags (many)
collections (many) ──< collection_saved_items >── saved_items (many)
profiles (many) ──< follows >── profiles (many)
profiles (many) ──< recipe_favorites >── recipes (many)
profiles (many) ──< post_favorites >── posts (many)
profiles (many) ──< recipe_reposts >── recipes (many)
profiles (many) ──< post_reposts >── posts (many)
profiles (many) ──< post_tagged_users >── posts (many)
profiles (many) ──< recipe_tagged_users >── recipes (many)
post_comments (1) ──< post_comment_mentions >── profiles (many)
recipe_comments (1) ──< recipe_comment_mentions >── profiles (many)

Core Tables

profiles

Extends Supabase auth.users with profile data.
ColumnTypeNotes
idUUID (PK, FK)References auth.users(id)
usernameTEXTUnique, required
first_nameTEXTRequired
surnameTEXTRequired
locationTEXTOptional, default ”
instagram_handleTEXTOptional
bioTEXTOptional, default ”
avatar_urlTEXTSupabase Storage URL
cover_photo_urlTEXTSupabase Storage URL
recipe_countINTEGERDenormalized counter (trigger-maintained)
post_countINTEGERDenormalized counter
collection_countINTEGERDenormalized counter
follower_countINTEGERDenormalized counter
following_countINTEGERDenormalized counter
created_atTIMESTAMPTZAuto
updated_atTIMESTAMPTZAuto

recipes

Fujifilm film simulation recipes with all camera settings.
ColumnTypeNotes
idUUID (PK)Auto-generated
user_idUUID (FK)References profiles(id)
titleTEXTRequired
descriptionTEXTOptional
camera_modelTEXTOptional
cover_image_urlTEXTFirst image or selected
film_simulationTEXTDefault: ‘Provia’
dynamic_rangeTEXTDefault: ‘DR100’
grain_effectTEXTDefault: ‘Off’
color_chrome_effectTEXTDefault: ‘Off’
color_chrome_effect_blueTEXTDefault: ‘Off’
white_balance_modeTEXTDefault: ‘Auto’
white_balance_kelvinINTEGERDefault: 5500
white_balance_redINTEGERDefault: 0
white_balance_blueINTEGERDefault: 0
highlightINTEGERRange: -2 to +4
shadowINTEGERRange: -2 to +4
colorINTEGERRange: -4 to +4
sharpnessINTEGERRange: -4 to +4
noise_reductionINTEGERRange: -4 to +4
clarityINTEGERRange: -5 to +5
iso_settingTEXTOptional
exposure_compensationTEXTOptional
is_deletedBOOLEANSoft delete flag
created_atTIMESTAMPTZAuto
updated_atTIMESTAMPTZAuto
comment_countINTEGERDenormalized counter (trigger-maintained)
favorite_countINTEGERDenormalized counter
repost_countINTEGERDenormalized counter

posts

Photo posts with optional recipe linking.
ColumnTypeNotes
idUUID (PK)Auto-generated
user_idUUID (FK)References profiles(id)
titleTEXTOptional
captionTEXTRequired
camera_modelTEXTOptional
film_simulationTEXTOptional, validated against allowed values
recipe_idUUID (FK)Optional recipe link
cover_image_urlTEXTFirst image
is_deletedBOOLEANSoft delete flag
created_atTIMESTAMPTZAuto
updated_atTIMESTAMPTZAuto
comment_countINTEGERDenormalized counter
favorite_countINTEGERDenormalized counter
repost_countINTEGERDenormalized counter

collections

User-created groupings of saved content.
ColumnTypeNotes
idUUID (PK)Auto-generated
user_idUUID (FK)References profiles(id)
nameTEXTRequired
descriptionTEXTOptional
cover_recipe_idTEXTLoose reference (no FK constraint)
is_publicBOOLEANVisibility toggle
is_deletedBOOLEANSoft delete flag
item_countINTEGERDenormalized counter (trigger-maintained)
created_atTIMESTAMPTZAuto
updated_atTIMESTAMPTZAuto

Lightroom Settings

lightroom_settings

Optional Adobe Lightroom editing settings linked 1:1 to a recipe.
ColumnTypeRangeDefault
idUUID (PK)Auto-generated
recipe_idUUID (FK, unique)References recipes(id)
exposureNUMERIC-5.0 to 5.00
contrastINTEGER-100 to 1000
highlightsINTEGER-100 to 1000
shadowsINTEGER-100 to 1000
whitesINTEGER-100 to 1000
blacksINTEGER-100 to 1000
temperatureINTEGER-100 to 1000
tintINTEGER-100 to 1000
vibranceINTEGER-100 to 1000
saturationINTEGER-100 to 1000
clarityINTEGER-100 to 1000
dehazeINTEGER-100 to 1000
textureINTEGER-100 to 1000
sharpeningINTEGER0 to 1500
noise_reductionINTEGER0 to 1000

Junction / Relationship Tables

Content Media & Tags

TablePurposeKeys
recipe_imagesImages per recipe (max 10)recipe_id, image_url, is_cover, display_order
recipe_tagsTags on recipesrecipe_id, tag
post_imagesImages per postpost_id, image_url, is_cover, display_order
post_tagsTags on postspost_id, tag

Social Relationships

TablePurposeComposite PK
followsUser follow relationships(follower_id, following_id)
recipe_favoritesRecipe likes(user_id, recipe_id)
post_favoritesPost likes(user_id, post_id)
recipe_repostsRecipe reposts(user_id, recipe_id)
post_repostsPost reposts(user_id, post_id)

Saved Items & Collections

TablePurposeKeys
saved_itemsBookmarked contentuser_id, content_type (post/recipe/collection), content_id
collection_saved_itemsItems in collections(collection_id, saved_item_id)

Comments

TablePurposeKeys
post_commentsComments on postspost_id, user_id, content
recipe_commentsComments on recipesrecipe_id, user_id, content
collection_comments, collection_favorites, collection_reposts, and collection_tagged_users were removed in a previous migration. Collections are organizational tools, not social content — they don’t support comments, favorites, reposts, or tagging.

User Tagging

TablePurposeComposite PK
post_tagged_usersUsers tagged in posts(post_id, tagged_user_id)
recipe_tagged_usersUsers tagged in recipes(recipe_id, tagged_user_id)

Comment Mentions

TablePurposeComposite PK
post_comment_mentions@mentions in post comments(comment_id, mentioned_user_id)
recipe_comment_mentions@mentions in recipe comments(comment_id, mentioned_user_id)
A collection_comment_mentions table previously existed but was dropped along with collection_comments. Collection notification types are no longer part of the notifications constraint.

Notifications

ColumnTypeNotes
idUUID (PK)Auto-generated
recipient_idUUID (FK)User receiving the notification
actor_idUUID (FK)User who triggered it
typeTEXTSee allowed types below
content_typeTEXTpost, recipe, collection, or profile
content_idUUIDThe content being referenced
comment_idUUIDOptional — set for mention notifications
is_readBOOLEANDefault false
created_atTIMESTAMPTZAuto
Allowed notification types (enforced by CHECK constraint):
TypeTrigger
tag_postUser tagged in a post
tag_recipeUser tagged in a recipe
mention_post_comment@mentioned in a post comment
mention_recipe_comment@mentioned in a recipe comment
followAnother user followed this profile
Follow notifications reference the follower’s profile (content_type = 'profile'). Collection notification types were removed from the allowed notification set.

Fujifilm Settings Reference

Film Simulations

Provia, Velvia, Astia, Classic Chrome, Pro Neg Hi, Pro Neg Std, Classic Neg, Eterna, Eterna Bleach Bypass, Acros, Acros+Ye, Acros+R, Acros+G, Monochrome, Monochrome+Ye, Monochrome+R, Monochrome+G, Sepia, Nostalgic Neg, Reala Ace

Setting Ranges

SettingMinMax
Highlight-2+4
Shadow-2+4
Color-4+4
Sharpness-4+4
Noise Reduction-4+4
Clarity-5+5
WB Red/Blue Shift-9+9
Kelvin250010000

Views

There are NO database views in the live database. The project rules reference recipe_with_stats and collection_with_stats views — these do not exist. All stats (favorite_count, comment_count, repost_count) are denormalized directly on the parent tables (recipes, posts, collections). Author info is joined inline by the RPC functions (get_recipe_detail, get_post_detail, etc.).