Adding cache schema version - #1204
Open
EngCaioFonseca wants to merge 4 commits into
Open
Conversation
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
Contributor
|
#1189 made changes to the schema, so this may need to change to account for that |
MoralCode
reviewed
Aug 25, 2026
Comment on lines
+14
to
+16
| Our data model is fairly simple, so for now the overhead of proper | ||
| db migration tooling is mostly bloaty. We can return to this decision | ||
| in the future if necessary. | ||
| Our data model is fairly simple, so we do not use alembic. Schema | ||
| changes to existing tables are numbered SQL functions in MIGRATIONS | ||
| below, applied on startup. We can return to alembic later if needed. |
Contributor
There was a problem hiding this comment.
can you elaborate on why we aren't using alembic? This seems like a very odd technical decision to me, especially if we are using SQL functions in its place
Contributor
Author
There was a problem hiding this comment.
Fair point, and I kinda agree, but in this we're not removing alembic, or touching it in this repo. I've updated the comment to explain the reasoning behind it. In summary, since it is a small fixed schema, as well as disposable/unlogged and rebuildable cache, it's easier and more efficient to not use it and it's the reason why we don't need it.
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
EngCaioFonseca
marked this pull request as ready for review
August 30, 2026 23:51
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
EngCaioFonseca
force-pushed
the
cache_schema_version
branch
from
August 30, 2026 23:54
6f12892 to
ce7a917
Compare
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.
Pull Request Change Description
This solves #1198 and adds the cache schema versioning as well as lay the groundwork for the follow up steps or making the cache persistent.
The cache schema is now versioned with Alembic. It runs on startup: a fresh cache gets stamped at the latest version, and an existing cache gets any missing migrations applied automatically. Base tables are still created with the raw CREATE blocks in db_init.py, so adding a new table works exactly like before. Alembic only handles changes to existing tables.
The first migration adds the labels column from #1189. Existing caches never got it, because CREATE TABLE IF NOT EXISTS doesn't touch a table that already exists. The migration adds the column and clears the old cached issues so they get re-collected with labels.
A few things added for the cache long-term:
This is also groundwork for making the cache persistent instead of rebuilt on every boot.
Generative AI disclosure
Please select one option:
If AI tools were used, please provide details below:
- What tools were used? Claude - Opus 4.8; GPT - 5.6 Sol
- How were these tools used? Draft, review iteration.
- Did you review these outputs before submitting this PR? Yes.