Every bot file was chunked into bot_file_chunks and embedded into bot_file_vectors, and uploads kept their extracted text in media.text_content, which together took most of the database. Bot files are no longer indexed: bots find them by name or path with list_files and read them with read_file, and search_files, ingest_file and the files modal's re-read button are gone. Attachments keep no text; a reply reads a document from the file. Only knowledgebase documents keep text. The schema drops both tables and the ingest columns. At boot, dropStoredFileText removes what older versions stored (file jobs, upload text) and vacuums once much of the database is free. The media:prune-text script it replaces is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { renderToString } from "react-dom/server";
|
|
import type { DatabaseTableSummary } from "@/src/types";
|
|
import DatabaseTableRow from "./database-table-row";
|
|
|
|
const table: DatabaseTableSummary = {
|
|
name: "knowledgebase_vectors",
|
|
type: "virtual",
|
|
rows: 12,
|
|
size_bytes: 2048,
|
|
columns: [],
|
|
key: { kind: "none" },
|
|
};
|
|
|
|
describe("DatabaseTableRow", () => {
|
|
test("names the table, its record count and its size", () => {
|
|
const html = renderToString(<DatabaseTableRow table={table} selected={false} onOpen={() => {}} />);
|
|
|
|
expect(html).toContain("knowledgebase_vectors");
|
|
expect(html).toContain("12");
|
|
expect(html).toContain("2.0 KB");
|
|
});
|
|
|
|
test("links to the table's own address", () => {
|
|
const html = renderToString(<DatabaseTableRow table={table} selected={false} onOpen={() => {}} />);
|
|
|
|
expect(html).toContain(`href="/admin/settings/database?table=knowledgebase_vectors"`);
|
|
});
|
|
|
|
test("a table with no count yet shows a dash", () => {
|
|
const html = renderToString(
|
|
<DatabaseTableRow
|
|
table={{ ...table, rows: null, size_bytes: null }}
|
|
selected={false}
|
|
onOpen={() => {}}
|
|
/>,
|
|
);
|
|
|
|
expect(html).toContain("-");
|
|
});
|
|
});
|