mariadb.sql 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. --
  2. -- MariaDB vector tables. The installer runs this file after system.sql and before addon.sql
  3. -- when the server is MariaDB 11.7 or newer. UUID and VECTOR are not available before that.
  4. -- One table per embedding width. A VECTOR column has a fixed width, so 1024 and 384 cannot share a table.
  5. --
  6. DROP TABLE IF EXISTS `sys_agents_vector_mariadb_1024`, `sys_agents_vector_mariadb_384`;
  7. CREATE TABLE IF NOT EXISTS `sys_agents_vector_mariadb_1024` (
  8. `id` uuid NOT NULL,
  9. `content` text,
  10. `sourceType` varchar(255),
  11. `sourceName` varchar(255),
  12. `metadata` json,
  13. `embedding` vector(1024) NOT NULL,
  14. PRIMARY KEY (`id`),
  15. KEY `sourceType` (`sourceType`),
  16. VECTOR INDEX (`embedding`)
  17. ) ENGINE=InnoDB;
  18. CREATE TABLE IF NOT EXISTS `sys_agents_vector_mariadb_384` (
  19. `id` uuid NOT NULL,
  20. `content` text,
  21. `sourceType` varchar(255),
  22. `sourceName` varchar(255),
  23. `metadata` json,
  24. `embedding` vector(384) NOT NULL,
  25. PRIMARY KEY (`id`),
  26. KEY `sourceType` (`sourceType`),
  27. VECTOR INDEX (`embedding`)
  28. ) ENGINE=InnoDB;