refactor(capture): the unit's tables move into downloads/models

The nine Capture tables (files, jobs, folders, shares, links, quota, cookies, profiles, library
resume points) leave app/models.py for the unit's own module; app.tables registers every unit's
tables for the migrations, the test database and the ownership check. No schema change.
This commit is contained in:
2026-10-18 23:45:53 +02:00
parent d66174ed16
commit 3a688fa0f5
48 changed files with 469 additions and 429 deletions
@@ -29,8 +29,10 @@ describe("display-name bound", () => {
it("is the width the columns are actually declared with", () => {
// The mutation guard for the check above: both constants could agree on a number neither
// column uses. `String(DISPLAY_TEXT_MAX)` is how the three display columns are declared, so a
// literal creeping back into one of them fails here.
const models = src("../../../../backend/app/models.py");
// literal creeping back into one of them fails here. `User.display_name` is a core table; the
// job's two are Capture's.
const models =
src("../../../../backend/app/models.py") + src("../../../../backend/app/downloads/models.py");
const declared = [...models.matchAll(/display_(?:name|uploader): Mapped.*?String\((.*?)\)/g)];
expect(declared).toHaveLength(3);
for (const m of declared) expect(m[1]).toBe("DISPLAY_TEXT_MAX");