Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4y agoβ€’
2 replies
Jordan

How to maintain record history

Hey, I'm looking for a bit of advice for how to handle history of tables that have foreign keys where the foreign keys data can change.

I'm working on a fitness app and have a table for every day you did a workout, which has a foreign key for a routine which has a foreign key for exercises.

For example, a routine can be changed. Initially, you have a routine which has pull-ups and you then remove that and change it to deadlifts, but you have already completed a few workouts before you make this change.

When you are viewing your history, I want it to be kept as it was when you completed that workout.

If I completed the initial workout on Monday then change it on Wednesday and complete an updated workout when I review my workout history, I want it to have:
"Monday: routine-1: pull-ups, Wednesday: routine-1: deadlifts"

Is this possible, and if so, is there a good way to implement this?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to get chat history?
SupabaseSSupabase / help-and-questions
4mo ago
How to Create a Data History
SupabaseSSupabase / help-and-questions
3y ago
Migration History
SupabaseSSupabase / help-and-questions
6mo ago
How to keep Leading Zeros in record?
SupabaseSSupabase / help-and-questions
4y ago