From 98dadd151aabb0d34f561b2fda40a9b7519f92ec Mon Sep 17 00:00:00 2001 From: Luis Novo Date: Tue, 10 Feb 2026 11:24:17 -0300 Subject: [PATCH] fix: turn the embedding field into optional (#557) * fix: turn the embedding field into optional * enable migration 13 - fixes: #556 --- open_notebook/database/async_migrate.py | 6 ++++++ open_notebook/database/migrations/13.surrealql | 3 +++ open_notebook/database/migrations/13_down.surrealql | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 open_notebook/database/migrations/13.surrealql create mode 100644 open_notebook/database/migrations/13_down.surrealql diff --git a/open_notebook/database/async_migrate.py b/open_notebook/database/async_migrate.py index 2de354b..2908995 100644 --- a/open_notebook/database/async_migrate.py +++ b/open_notebook/database/async_migrate.py @@ -112,6 +112,9 @@ class AsyncMigrationManager: AsyncMigration.from_file( "open_notebook/database/migrations/12.surrealql" ), + AsyncMigration.from_file( + "open_notebook/database/migrations/13.surrealql" + ), ] self.down_migrations = [ AsyncMigration.from_file( @@ -150,6 +153,9 @@ class AsyncMigrationManager: AsyncMigration.from_file( "open_notebook/database/migrations/12_down.surrealql" ), + AsyncMigration.from_file( + "open_notebook/database/migrations/13_down.surrealql" + ), ] self.runner = AsyncMigrationRunner( up_migrations=self.up_migrations, diff --git a/open_notebook/database/migrations/13.surrealql b/open_notebook/database/migrations/13.surrealql new file mode 100644 index 0000000..fe35f00 --- /dev/null +++ b/open_notebook/database/migrations/13.surrealql @@ -0,0 +1,3 @@ + +DEFINE FIELD OVERWRITE embedding ON TABLE source_insight TYPE option>; +DEFINE FIELD OVERWRITE embedding ON TABLE note TYPE option>; diff --git a/open_notebook/database/migrations/13_down.surrealql b/open_notebook/database/migrations/13_down.surrealql new file mode 100644 index 0000000..529d528 --- /dev/null +++ b/open_notebook/database/migrations/13_down.surrealql @@ -0,0 +1,2 @@ +DEFINE FIELD OVERWRITE embedding ON TABLE source_insight TYPE array; +DEFINE FIELD OVERWRITE embedding ON TABLE note TYPE array; \ No newline at end of file