little-librarian/migrations/20241107141344_documents.sql

12 lines
301 B
MySQL
Raw Normal View History

2025-07-01 08:55:08 +02:00
CREATE TABLE documents (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
book_id BIGINT NOT NULL,
version INTEGER NOT NULL,
text_chunk TEXT NOT NULL,
embedding vector(384) NOT NULL
);
CREATE INDEX ON documents
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);