Add foreign key script and Colab setup notebook#22
Merged
Conversation
- scripts/add_foreign_keys.py: fetches foreign_keys_regen.csv from GitHub, deduplicates FK definitions, and recreates SQLite tables with proper FOREIGN KEY constraints (idempotent) - scripts/setup_cbdb.ipynb: Colab-ready notebook that clones the repo then runs download → add FKs → create views → create ADDRESSES → download result, each step controlled by a boolean flag in the configuration cell - README.md, scripts/README.md, scripts/README.zh.md: updated docs (EN + ZH) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
scripts/add_foreign_keys.py: fetchesforeign_keys_regen.csvfrom GitHub, deduplicates FK definitions, and recreates SQLite tables with properFOREIGN KEYconstraints (idempotent; 36 tables on current release)scripts/setup_cbdb.ipynb: Colab-ready notebook — clones this repo then runs: download DB → add FKs → create views → build ADDRESSES table → download result; each step toggled by a boolean flag in the config cellREADME.md,scripts/README.md,scripts/README.zh.md): updated EN + ZH to document new scriptsTest plan
add_foreign_keys.pytested locally against latest release: 36 tables updated, idempotent on second runcreate_views.shneeds Linux)🤖 Generated with Claude Code