chore(db): accurate schema.sql + schema redesign proposal#7
Open
StockerMC wants to merge 1 commit into
Open
Conversation
The committed schema.sql was stale (predated most tables/columns, had a 'FIXME: actually update our DB' note). Regenerate it from the live database with every table/column/index/FK/function, annotated by real-world status (ACTIVE / LEGACY / DEAD / WORKER). Add docs/schema-redesign.md: evaluates how the DB is used today (three generations of the matching pipeline, merchant/creator identity split across multiple tables, dead + worker tables in public) and proposes a cleaner 18->11 table target with a phased migration plan.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Two docs, no schema executed.
1. Regenerated
backend/data/schema.sqlThe committed schema was stale (predated most tables/columns, had a
FIXME: actually update our DBnote). Regenerated from the live database with every table/column/index/FK/function, each table annotated by real-world status: ACTIVE / LEGACY / DEAD / WORKER.2. New
docs/schema-redesign.mdEvaluates how the DB is used today and proposes a cleaner target:
company_products→product_creator_matches→creator_videos) is alive.companies+shopify_shops+shopify_oauth_tokens(access_token stored twice).product_pages,matches) and worker (yt_shorts_all/pending) tables sit inpublic.Proposes 18 → 11 tables with a 4-phase migration plan. Phase 1 (drop confirmed-dead
product_pages+matches) is the only safe-now step and is held for explicit approval.No
DROP/ALTERis run by this PR — it's documentation + an accurate snapshot.