# migrations

dir: embeddings_queue
filename: 00001-embeddings.sqlite.sql
hash: d3755dfd232be8e8301f4d7fcfb3a486
sql:
CREATE TABLE embeddings_queue (
    seq_id INTEGER PRIMARY KEY,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    operation INTEGER NOT NULL,
    topic TEXT NOT NULL,
    id TEXT NOT NULL,
    vector BLOB,
    encoding TEXT,
    metadata TEXT
);


dir: sysdb
filename: 00001-collections.sqlite.sql
hash: 38352d725ad1c16074fac420b22b4633
sql:
CREATE TABLE collections (
    id TEXT PRIMARY KEY,
    name TEXT NOT NULL,
    topic TEXT NOT NULL,
    UNIQUE (name)
);

CREATE TABLE collection_metadata (
    collection_id TEXT REFERENCES collections(id) ON DELETE CASCADE,
    key TEXT NOT NULL,
    str_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (collection_id, key)
);


dir: sysdb
filename: 00002-segments.sqlite.sql
hash: 2913cb6a503055a95f625448037e8912
sql:
CREATE TABLE segments (
    id TEXT PRIMARY KEY,
    type TEXT NOT NULL,
    scope TEXT NOT NULL,
    topic TEXT,
    collection TEXT REFERENCES collection(id)
);

CREATE TABLE segment_metadata (
    segment_id TEXT  REFERENCES segments(id) ON DELETE CASCADE,
    key TEXT NOT NULL,
    str_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (segment_id, key)
);


dir: sysdb
filename: 00004-tenants-databases.sqlite.sql
hash: 048867ce8fcdefe4023c7110e4433591
sql:
CREATE TABLE IF NOT EXISTS tenants (
    id TEXT PRIMARY KEY,
    UNIQUE (id)
);

CREATE TABLE IF NOT EXISTS databases (
    id TEXT PRIMARY KEY, -- unique globally
    name TEXT NOT NULL, -- unique per tenant
    tenant_id TEXT NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
    UNIQUE (tenant_id, name) -- Ensure that a tenant has only one database with a given name
);

CREATE TABLE IF NOT EXISTS collections_tmp (
    id TEXT PRIMARY KEY, -- unique globally
    name TEXT NOT NULL, -- unique per database
    topic TEXT NOT NULL,
    dimension INTEGER,
    database_id TEXT NOT NULL REFERENCES databases(id) ON DELETE CASCADE,
    UNIQUE (name, database_id)
);

-- Create default tenant and database
INSERT OR REPLACE INTO tenants (id) VALUES ('default_tenant'); -- The default tenant id is 'default_tenant' others are UUIDs
INSERT OR REPLACE INTO databases (id, name, tenant_id) VALUES ('00000000-0000-0000-0000-000000000000', 'default_database', 'default_tenant');

INSERT OR REPLACE INTO collections_tmp (id, name, topic, dimension, database_id)
    SELECT id, name, topic, dimension, '00000000-0000-0000-0000-000000000000' FROM collections;
DROP TABLE collections;
ALTER TABLE collections_tmp RENAME TO collections;


dir: metadb
filename: 00001-embedding-metadata.sqlite.sql
hash: 2b4cf52c4bb2676e21d6860a4409f856
sql:
CREATE TABLE embeddings (
    id INTEGER PRIMARY KEY,
    segment_id TEXT NOT NULL,
    embedding_id TEXT NOT NULL,
    seq_id BLOB NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    UNIQUE (segment_id, embedding_id)
);

CREATE TABLE embedding_metadata (
    id INTEGER REFERENCES embeddings(id),
    key TEXT NOT NULL,
    string_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (id, key)
);

CREATE TABLE max_seq_id (
    segment_id TEXT PRIMARY KEY,
    seq_id BLOB NOT NULL
);

CREATE VIRTUAL TABLE embedding_fulltext USING fts5(id, string_value);


dir: metadb
filename: 00002-embedding-metadata.sqlite.sql
hash: 12a570f7121b3a8ce750a2a7c36da20f
sql:
-- SQLite does not support adding check with alter table, as a result, adding a check
-- involve creating a new table and copying the data over. It is over kill with adding
-- a boolean type column. The application write to the table needs to ensure the data
-- integrity.
ALTER TABLE embedding_metadata ADD COLUMN bool_value INTEGER


dir: metadb
filename: 00003-full-text-tokenize.sqlite.sql
hash: f97ad6334aeaa8f419f01110b648b97a
sql:
CREATE VIRTUAL TABLE embedding_fulltext_search USING fts5(string_value, tokenize='trigram');
INSERT INTO embedding_fulltext_search (rowid, string_value) SELECT rowid, string_value FROM embedding_metadata;
DROP TABLE embedding_fulltext;


# embeddings_queue

created_at: 2024-01-17 10:32:47
topic: persistent://default/default/3fa122ba-62a5-4b8e-a922-650824109aa0
encoding: FLOAT32
id:
22e12c6d-51c6-499d-b16a-6444e99aacc7--90b017fd007ce173056867079312d2b8af2e8ff59fbabd5f0f46a6ccb790a606

metadata:
{"url": "https://dev.mysql.com/doc/", "data_type": "web_page", "doc_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7--36f95a25c92efd8958f2da96296a631b74328552adfcf2b5b46ec271c3c520f5", "app_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7", "hash": "b74169750234ebc61affe559f9dd6e91", "chroma:document": "MySQL : MySQL Documentation Skip to Main Content MySQL Documentation MySQL HeatWave One MySQL Database service for OLTP, OLAP, ML, and Lakehouse MySQL Docs HeatWave Docs Unmatched price performance 4.2X faster than Amazon Redshift at one-fifth the cost 3.3X faster than Snowflake at one-eighth the cost 1,400X faster than Aurora at half the cost Available on OCI, AWS, and Azure MySQL Shorts Video Series Looking to improve your MySQL skills? The MySQL Shorts video series provides technical how-to, tips, and tricks from the experts at MySQL. The short-form videos make it easy to improve your MySQL skills, fast! Watch the MySQL Shorts Video Series \u00bb MySQL 8.0Reference Manual MySQL 8.0Release Notes Browse MySQL Documentation by: Product Topic Cloud Cloud Guides User guides for various cloud services MySQL HeatWave Service on OCI MySQL HeatWave on AWS MySQL HeatWave for Azure MySQL HeatWave User Guide MySQL on OCI Marketplace Cloud Release Notes Release notes for various cloud services MySQL HeatWave Service on OCI MySQL HeatWave on AWS MySQL HeatWave for Azure MySQL HeatWave MySQL Enterprise MySQL Enterprise Monitor MySQL Enterprise Backup MySQL Enterprise Backup 8.3 MySQL Enterprise Backup 8.0 MySQL Enterprise Backup 4.1 Oracle Enterprise Manager for MySQL Database MySQL Enterprise Security MySQL Enterprise Encryption MySQL Enterprise Audit MySQL Enterprise Firewall MySQL Enterprise Thread Pool MySQL Enterprise Data Masking and De-Identification High Availability, Replication, and Scalability Solutions MySQL AdminAPI MySQL InnoDB Cluster MySQL InnoDB ClusterSet MySQL InnoDB ReplicaSet Replication Group Replication Semisynchronous Replication MySQL Operator for Kubernetes MySQL Router MySQL NDB Cluster MySQL NDB Cluster 8.3 (Innovation) MySQL NDB Cluster 8.0 (GA) MySQL NDB Cluster 7.5/7.6 (GA) Installation Using the MySQL Yum Repository Using the MySQL APT Repository Using the MySQL SLES Repository MySQL Installer Secure Deployment Guide Secure Deployment Guide 8.0 Secure"}


created_at: 2024-01-17 10:32:47
topic: persistent://default/default/3fa122ba-62a5-4b8e-a922-650824109aa0
encoding: FLOAT32
id:
22e12c6d-51c6-499d-b16a-6444e99aacc7--83f8d4ea35434d90dee42c5622746e082c745f32ac8e473b3f8ec732363ab368

metadata:
{"url": "https://dev.mysql.com/doc/", "data_type": "web_page", "doc_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7--36f95a25c92efd8958f2da96296a631b74328552adfcf2b5b46ec271c3c520f5", "app_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7", "hash": "b74169750234ebc61affe559f9dd6e91", "chroma:document": "Deployment Guide 5.7 Other Guides MySQL Server-Tool Compatibility MySQL Port Reference MySQL Server & MySQL Cluster MySQL Reference Manual, MySQL NDB Cluster guides MySQL Reference Manual (incl. MySQL Cluster) MySQL 8.3 Reference Manual MySQL 8.0 Reference Manual MySQL 8.0 Reference Manual (Japanese) MySQL 5.7 Reference Manual MySQL Version Reference MySQL Error Reference MySQL 8.3 Error Reference MySQL 8.0 Error Reference MySQL 5.7 Error Reference NDB Cluster API Developer Guide NDB Cluster Internals Manual MySQL Cluster Manager MySQL Cluster Manager 8.3 MySQL Cluster Manager 8.0 MySQL Cluster Manager 1.4 NDB Operator NDB Operator 8.3 NDB Operator 8.0 MySQL Workbench, Shell, Router MySQL client tools and middleware MySQL Workbench MySQL Shell MySQL Shell 8.3 User Guide MySQL Shell 8.0 User Guide MySQL Shell 8.0 User Guide (Japanese) MySQL Shell for VS Code MySQL REST Service MySQL Router MySQL Router 8.3 User Guide MySQL Router 8.0 User Guide Connectors & APIs Database drivers and APIs Connector/J Connector/ODBC Connector/NET Developer Guide API Reference Connector/Python PHP C API C API 8.3 C API 8.0 C API 5.7 Connector/C+ Connector/C+ 8.3 Connector/C+ 1.1 X DevAPI API for MySQL Shell and Connectors supporting the X Protocol X DevAPI User Guide X DevAPI User Guide for MySQL Shell in JavaScript Mode X DevAPI User Guide for MySQL Shell in Python Mode MySQL Connector/C+ X DevAPI Reference MySQL Connector/J X DevAPI Reference MySQL Connector/NET Reference with X DevAPI MySQL Connector/Node.js X DevAPI Reference MySQL Connector/Python X DevAPI Reference MySQL Shell JavaScript API Reference MySQL Shell JavaScript 8.3 API Reference MySQL Shell JavaScript 8.0 API Reference MySQL Shell Python API Reference MySQL Shell Python 8.3 API Reference MySQL Shell Python 8.0 API Reference Expert Guides MySQL Server Doxygen Documentation Extending MySQL Extending MySQL 8.3 Extending MySQL 8.0 Extending MySQL 5.7 MySQL Test Framework 2.0 Current Release Notes MySQL Server MySQL 8.3.0"}


created_at: 2024-01-17 10:32:47
topic: persistent://default/default/3fa122ba-62a5-4b8e-a922-650824109aa0
encoding: FLOAT32
id:
22e12c6d-51c6-499d-b16a-6444e99aacc7--7ba74b927f9e2dc1d5bb201753e9db47684c1d516e4b45c02172ab56a14cdcdf

metadata:
{"url": "https://dev.mysql.com/doc/", "data_type": "web_page", "doc_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7--36f95a25c92efd8958f2da96296a631b74328552adfcf2b5b46ec271c3c520f5", "app_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7", "hash": "b74169750234ebc61affe559f9dd6e91", "chroma:document": "Innovation MySQL 8.0.36 Bugfix MySQL 5.7.44 MySQL NDB Cluster MySQL Cluster (NDB) 8.3.0 MySQL Cluster (NDB) 8.0.36 MySQL Cluster (NDB) 7.6.29 MySQL Cluster (NDB) 7.5.33 MySQL Shell MySQL Shell 8.3.0 MySQL Shell 8.0.36 MySQL Enterprise Backup MySQL Enterprise Backup 8.3.0 MySQL Enterprise Backup 8.0.36 MySQL Router MySQL Router 8.3.0 MySQL Router 8.0.36 MySQL Operator MySQL Operator 8.3.0 MySQL Operator 8.0.36 MySQL Workbench 8.0.36 MySQL Connector/C+ 8.3.0 MySQL Connector/J 8.3.0 MySQL Connector/NET 8.3.0 MySQL Connector/ODBC MySQL Connector/ODBC 8.3.0 MySQL Connector/ODBC 8.0.36 MySQL Connector/Python 8.3.0 MySQL Cluster Manager MySQL Cluster Manager 8.3.0 MySQL Cluster Manager 8.0.36 MySQL NDB Operator MySQL NDB Operator 8.3.0 MySQL NDB Operator 8.0.36 All Release Notes MySQL Server MySQL 8.3 Innovation MySQL 8.2 Innovation MySQL 8.1 Innovation MySQL 8.0 Bugfix MySQL 5.7 NDB Cluster NDB Cluster 8.3 NDB Cluster 8.2 NDB Cluster 8.1 NDB Cluster 8.0 NDB Cluster 7.6 NDB Cluster 7.5 MySQL Cluster Manager MySQL Cluster Manager 8.3 MySQL Cluster Manager 8.2 MySQL Cluster Manager 8.1 MySQL Cluster Manager 8.0 MySQL Cluster Manager 1.4 MySQL NDB Operator MySQL NDB Operator 8.3 MySQL NDB Operator 8.2 MySQL NDB Operator 8.1 MySQL NDB Operator 8.0 MySQL Enterprise Monitor MySQL Enterprise Monitor 8.0 Oracle Enterprise Manager for MySQL Database MySQL Enterprise Backup MySQL Enterprise Backup 8.3 MySQL Enterprise Backup 8.2 MySQL Enterprise Backup 8.1 MySQL Enterprise Backup 8.0 MySQL Enterprise Backup 4.1 MySQL Shell MySQL Shell 8.3 MySQL Shell 8.2 MySQL Shell 8.1 MySQL Shell 8.0 Connector/J Connector/ODBC Connector/NET Connector/Node.js Connector/Python Connector/C+ MySQL Installer MySQL Workbench MySQL Router MySQL Router 8.3 MySQL Router 8.2 MySQL Router 8.1 MySQL Router 8.0 MySQL Operator for Kubernetes MySQL Operator for Kubernetes 8.3 MySQL Operator for Kubernetes 8.2 MySQL Operator for Kubernetes 8.1 MySQL Operator for Kubernetes 8.0 Administrator Guides Content has"}


created_at: 2024-01-17 10:32:47
topic: persistent://default/default/3fa122ba-62a5-4b8e-a922-650824109aa0
encoding: FLOAT32
id:
22e12c6d-51c6-499d-b16a-6444e99aacc7--5bd4b9d26a8034208a125389c1e19db91d9fea696c991ec5ad2db48be5a7be75

metadata:
{"url": "https://dev.mysql.com/doc/", "data_type": "web_page", "doc_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7--36f95a25c92efd8958f2da96296a631b74328552adfcf2b5b46ec271c3c520f5", "app_id": "22e12c6d-51c6-499d-b16a-6444e99aacc7", "hash": "b74169750234ebc61affe559f9dd6e91", "chroma:document": "moved here Developers & Functionality Content has moved here MySQL Enterprise Content has moved here Connectors & APIs Content has moved here HA/Scalability Content has moved here Content has moved here Content has moved here Download this Manual"}


# embedding_metadata

key: doc_id
string_value:
22e12c6d-51c6-499d-b16a-6444e99aacc7--36f95a25c92efd8958f2da96296a631b74328552adfcf2b5b46ec271c3c520f5


key: chroma:document
string_value:
MySQL : MySQL Documentation Skip to Main Content MySQL Documentation MySQL HeatWave One MySQL Database service for OLTP, OLAP, ML, and Lakehouse MySQL Docs HeatWave Docs Unmatched price performance 4.2X faster than Amazon Redshift at one-fifth the cost 3.3X faster than Snowflake at one-eighth the cost 1,400X faster than Aurora at half the cost Available on OCI, AWS, and Azure MySQL Shorts Video Series Looking to improve your MySQL skills? The MySQL Shorts video series provides technical how-to, tips, and tricks from the experts at MySQL. The short-form videos make it easy to improve your MySQL skills, fast! Watch the MySQL Shorts Video Series » MySQL 8.0Reference Manual MySQL 8.0Release Notes Browse MySQL Documentation by: Product Topic Cloud Cloud Guides User guides for various cloud services MySQL HeatWave Service on OCI MySQL HeatWave on AWS MySQL HeatWave for Azure MySQL HeatWave User Guide MySQL on OCI Marketplace Cloud Release Notes Release notes for various cloud services MySQL HeatWave Service on OCI MySQL HeatWave on AWS MySQL HeatWave for Azure MySQL HeatWave MySQL Enterprise MySQL Enterprise Monitor MySQL Enterprise Backup MySQL Enterprise Backup 8.3 MySQL Enterprise Backup 8.0 MySQL Enterprise Backup 4.1 Oracle Enterprise Manager for MySQL Database MySQL Enterprise Security MySQL Enterprise Encryption MySQL Enterprise Audit MySQL Enterprise Firewall MySQL Enterprise Thread Pool MySQL Enterprise Data Masking and De-Identification High Availability, Replication, and Scalability Solutions MySQL AdminAPI MySQL InnoDB Cluster MySQL InnoDB ClusterSet MySQL InnoDB ReplicaSet Replication Group Replication Semisynchronous Replication MySQL Operator for Kubernetes MySQL Router MySQL NDB Cluster MySQL NDB Cluster 8.3 (Innovation) MySQL NDB Cluster 8.0 (GA) MySQL NDB Cluster 7.5/7.6 (GA) Installation Using the MySQL Yum Repository Using the MySQL APT Repository Using the MySQL SLES Repository MySQL Installer Secure Deployment Guide Secure Deployment Guide 8.0 Secure


key: chroma:document
string_value:
Deployment Guide 5.7 Other Guides MySQL Server-Tool Compatibility MySQL Port Reference MySQL Server & MySQL Cluster MySQL Reference Manual, MySQL NDB Cluster guides MySQL Reference Manual (incl. MySQL Cluster) MySQL 8.3 Reference Manual MySQL 8.0 Reference Manual MySQL 8.0 Reference Manual (Japanese) MySQL 5.7 Reference Manual MySQL Version Reference MySQL Error Reference MySQL 8.3 Error Reference MySQL 8.0 Error Reference MySQL 5.7 Error Reference NDB Cluster API Developer Guide NDB Cluster Internals Manual MySQL Cluster Manager MySQL Cluster Manager 8.3 MySQL Cluster Manager 8.0 MySQL Cluster Manager 1.4 NDB Operator NDB Operator 8.3 NDB Operator 8.0 MySQL Workbench, Shell, Router MySQL client tools and middleware MySQL Workbench MySQL Shell MySQL Shell 8.3 User Guide MySQL Shell 8.0 User Guide MySQL Shell 8.0 User Guide (Japanese) MySQL Shell for VS Code MySQL REST Service MySQL Router MySQL Router 8.3 User Guide MySQL Router 8.0 User Guide Connectors & APIs Database drivers and APIs Connector/J Connector/ODBC Connector/NET Developer Guide API Reference Connector/Python PHP C API C API 8.3 C API 8.0 C API 5.7 Connector/C+ Connector/C+ 8.3 Connector/C+ 1.1 X DevAPI API for MySQL Shell and Connectors supporting the X Protocol X DevAPI User Guide X DevAPI User Guide for MySQL Shell in JavaScript Mode X DevAPI User Guide for MySQL Shell in Python Mode MySQL Connector/C+ X DevAPI Reference MySQL Connector/J X DevAPI Reference MySQL Connector/NET Reference with X DevAPI MySQL Connector/Node.js X DevAPI Reference MySQL Connector/Python X DevAPI Reference MySQL Shell JavaScript API Reference MySQL Shell JavaScript 8.3 API Reference MySQL Shell JavaScript 8.0 API Reference MySQL Shell Python API Reference MySQL Shell Python 8.3 API Reference MySQL Shell Python 8.0 API Reference Expert Guides MySQL Server Doxygen Documentation Extending MySQL Extending MySQL 8.3 Extending MySQL 8.0 Extending MySQL 5.7 MySQL Test Framework 2.0 Current Release Notes MySQL Server MySQL 8.3.0


key: chroma:document
string_value:
Innovation MySQL 8.0.36 Bugfix MySQL 5.7.44 MySQL NDB Cluster MySQL Cluster (NDB) 8.3.0 MySQL Cluster (NDB) 8.0.36 MySQL Cluster (NDB) 7.6.29 MySQL Cluster (NDB) 7.5.33 MySQL Shell MySQL Shell 8.3.0 MySQL Shell 8.0.36 MySQL Enterprise Backup MySQL Enterprise Backup 8.3.0 MySQL Enterprise Backup 8.0.36 MySQL Router MySQL Router 8.3.0 MySQL Router 8.0.36 MySQL Operator MySQL Operator 8.3.0 MySQL Operator 8.0.36 MySQL Workbench 8.0.36 MySQL Connector/C+ 8.3.0 MySQL Connector/J 8.3.0 MySQL Connector/NET 8.3.0 MySQL Connector/ODBC MySQL Connector/ODBC 8.3.0 MySQL Connector/ODBC 8.0.36 MySQL Connector/Python 8.3.0 MySQL Cluster Manager MySQL Cluster Manager 8.3.0 MySQL Cluster Manager 8.0.36 MySQL NDB Operator MySQL NDB Operator 8.3.0 MySQL NDB Operator 8.0.36 All Release Notes MySQL Server MySQL 8.3 Innovation MySQL 8.2 Innovation MySQL 8.1 Innovation MySQL 8.0 Bugfix MySQL 5.7 NDB Cluster NDB Cluster 8.3 NDB Cluster 8.2 NDB Cluster 8.1 NDB Cluster 8.0 NDB Cluster 7.6 NDB Cluster 7.5 MySQL Cluster Manager MySQL Cluster Manager 8.3 MySQL Cluster Manager 8.2 MySQL Cluster Manager 8.1 MySQL Cluster Manager 8.0 MySQL Cluster Manager 1.4 MySQL NDB Operator MySQL NDB Operator 8.3 MySQL NDB Operator 8.2 MySQL NDB Operator 8.1 MySQL NDB Operator 8.0 MySQL Enterprise Monitor MySQL Enterprise Monitor 8.0 Oracle Enterprise Manager for MySQL Database MySQL Enterprise Backup MySQL Enterprise Backup 8.3 MySQL Enterprise Backup 8.2 MySQL Enterprise Backup 8.1 MySQL Enterprise Backup 8.0 MySQL Enterprise Backup 4.1 MySQL Shell MySQL Shell 8.3 MySQL Shell 8.2 MySQL Shell 8.1 MySQL Shell 8.0 Connector/J Connector/ODBC Connector/NET Connector/Node.js Connector/Python Connector/C+ MySQL Installer MySQL Workbench MySQL Router MySQL Router 8.3 MySQL Router 8.2 MySQL Router 8.1 MySQL Router 8.0 MySQL Operator for Kubernetes MySQL Operator for Kubernetes 8.3 MySQL Operator for Kubernetes 8.2 MySQL Operator for Kubernetes 8.1 MySQL Operator for Kubernetes 8.0 Administrator Guides Content has


key: chroma:document
string_value:
moved here Developers & Functionality Content has moved here MySQL Enterprise Content has moved here Connectors & APIs Content has moved here HA/Scalability Content has moved here Content has moved here Content has moved here Download this Manual


