-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Align charts.updatedAt and chart_configs.updatedAt #3962
Conversation
f1eb20c
to
a813b4a
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-09-16 09:59:24 UTC |
Thinking about this some more, we'll run into the same issue again the next time someone runs a migration on If you don't mind me committing to your branch, then I could just add the rest of the code. |
If we always want them to be identical, shouldn't we have only one place to store that piece of data? |
Please do!
Yeah, that'd be ideal, but I have no idea how much harder could it be. As far as I know, virtual columns can't reference other tables. We could add trigger to automatically update it in mysql rather than in code, but I'll leave it to @sophiamersmann to pick her favorite option. |
Yeah, I agree that one place to store this information would be better, but the complexity of database triggers is probably not worth it. I added a database test, though, for good measure. @Marigold, I added the code necessary to update the
More generally speaking, my current approach makes it so that the |
Nope, this is fine for us. We are detecting identical configs in chart-sync anyway. I can't review my own PR, but consider it reviewed (even though I'm not a grapher expert). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to go in then, I think 👍🏻
Nice! Just to clarify, I didn't mean DB triggers. I thought maybe we could store it in the DB literally just once and then use a join or a separate query. But I obviously lack a lot of context. |
I found some charts where
charts.updatedAt
andchart_configs.updatedAt
. They should always match (or at least be very close), we depend on it in chart-sync.