Skip to content

Commit

Permalink
Merge pull request #548 from dcSpark/nico/fix_migration_from_0_7_to_0_8
Browse files Browse the repository at this point in the history
fix migration from 0_7_x to 0_8_x
  • Loading branch information
nicarq authored Sep 10, 2024
2 parents b171336 + 2ea4cd1 commit cdcb8d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shinkai-bin/shinkai-node/src/lance_db/shinkai_lance_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use super::shinkai_lancedb_error::ShinkaiLanceDBError;
use super::shinkai_tool_schema::ShinkaiToolSchema;

// Note: Add 1 to the current number to force an old fashion migration (delete all and then add all)
pub static LATEST_ROUTER_DB_VERSION: &str = "3";
pub static LATEST_ROUTER_DB_VERSION: &str = "4";

// TODO: we need a way to export and import the db (or tables). it could be much faster to reset.

Expand Down Expand Up @@ -75,7 +75,7 @@ impl LanceShinkaiDb {
.map_err(|e| ShinkaiLanceDBError::Schema(e.to_string()))?;

let table = match connection
.create_empty_table("tool_router", schema)
.create_empty_table("tool_router_v4", schema)
// .data_storage_version(LanceFileVersion::V2_1)
.execute()
.await
Expand All @@ -85,7 +85,7 @@ impl LanceShinkaiDb {
if let LanceDbError::TableAlreadyExists { .. } = e {
// If the table already exists, retrieve and return it
connection
.open_table("tool_router")
.open_table("tool_router_v4")
.execute()
.await
.map_err(ShinkaiLanceDBError::from)?
Expand Down

0 comments on commit cdcb8d1

Please sign in to comment.