Schema v4: a role's vote, summary and fetched posting text
One migration for the columns the phone UI's votes, summaries and read page need, so the packages that build those never both touch the schema. The columns sit before created_at in SCHEMA: SQLite cannot drop a last column whose preceding comment would then swallow the closing parenthesis, which the v1 migration test does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
eee17a6aaf
commit
8c4bc3112a
3 files changed
+29
-1
No files matched your search
@@ -264,6 +264,14 @@ class Role(Model):
|
||||
raw: JsonDict = {}
|
||||
extracted_at: str | None = None
|
||||
created_at: str
|
||||
#: None unjudged, else -1 pass, 0 neutral, 1 like.
|
||||
vote: Literal[-1, 0, 1] | None = None
|
||||
voted_at: str | None = None
|
||||
summary: str = ""
|
||||
summarised_at: str | None = None
|
||||
#: The posting page as plain text, for a role whose description is a teaser.
|
||||
article_text: str = ""
|
||||
article_at: str | None = None
|
||||
|
||||
|
||||
class ExtractResult(ModelTaskResult):
|
||||
|
||||
@@ -67,6 +67,17 @@ CREATE TABLE IF NOT EXISTS roles (
|
||||
-- Replies from extract that left this role unanswered. At GIVE_UP_AFTER it
|
||||
-- is no longer offered. A column, not raw, because every upsert rewrites raw.
|
||||
extract_tries INTEGER NOT NULL DEFAULT 0,
|
||||
-- The owner's judgement of the role: NULL unjudged, else -1 pass, 0
|
||||
-- neutral, 1 like. It moves the rank at read time and never hides a role.
|
||||
vote INTEGER CHECK (vote IN (-1, 0, 1)),
|
||||
voted_at TEXT,
|
||||
-- About 60 words from summarise, and when it wrote them.
|
||||
summary TEXT NOT NULL DEFAULT '',
|
||||
summarised_at TEXT,
|
||||
-- The posting's own page as plain text, fetched on demand for a role
|
||||
-- whose description is only a teaser.
|
||||
article_text TEXT NOT NULL DEFAULT '',
|
||||
article_at TEXT,
|
||||
created_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
@@ -225,6 +236,14 @@ CREATE TABLE vectors (
|
||||
);
|
||||
ALTER TABLE agents ADD COLUMN intent_key TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE agents ADD COLUMN intent_vec BLOB;
|
||||
"""),
|
||||
(4, "roles.vote, roles.summary and roles.article_text, for the phone UI", """
|
||||
ALTER TABLE roles ADD COLUMN vote INTEGER CHECK (vote IN (-1, 0, 1));
|
||||
ALTER TABLE roles ADD COLUMN voted_at TEXT;
|
||||
ALTER TABLE roles ADD COLUMN summary TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE roles ADD COLUMN summarised_at TEXT;
|
||||
ALTER TABLE roles ADD COLUMN article_text TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE roles ADD COLUMN article_at TEXT;
|
||||
"""),
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user