fix: add missing wakatime_stats table to canonical schema.sql (#2951)#3148
Open
yachikadev wants to merge 1 commit into
Open
fix: add missing wakatime_stats table to canonical schema.sql (#2951)#3148yachikadev wants to merge 1 commit into
yachikadev wants to merge 1 commit into
Conversation
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2951
Problem
The
wakatime_statstable (added via migration20260526000000_add_wakatime_stats.sql) was never backported tosupabase/schema.sql. Self-hosters who bootstrap their database directly fromschema.sqlend up missing this table, causing: relation "public.wakatime_stats" does not existwhen WakaTime sync (
/api/wakatime/sync) runs.Changes
wakatime_statstable definition tosupabase/schema.sql, matching the migration exactly (columns, FK tousers(id), unique constraint onuser_id, date).local_coding_sessions/user_sponsor_metrics) for consistency.);after theleaderboard_cachetable definition that was causing a SQL syntax error and breaking a freshschema.sqlrun before it could even reach the new table.Testing
schema.sqlagainst a fresh local Supabase Postgres instance — all tables (includingwakatime_stats) now create successfully.user_id TEXTcorrectly matchesusers.id(alsoTEXT), so the foreign key resolves without casting issues.schema.sqlare now consistent for this table.Notes for reviewer
The stray
);fix is a small drive-by fix needed to unblock testing this PR — happy to split it into a separate PR if preferred.