Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(db): skip the mcp client nullable migration on databases that never had the legacy client column

nirholas6fe7e14a0807
diff --git a/api/_lib/migrations/20261015010000_mcp_client_sessions_client_nullable.sql b/api/_lib/migrations/20261015010000_mcp_client_sessions_client_nullable.sql
index 098fdc6ba..ed94b8323 100644
--- a/api/_lib/migrations/20261015010000_mcp_client_sessions_client_nullable.sql
+++ b/api/_lib/migrations/20261015010000_mcp_client_sessions_client_nullable.sql
@@ -19,8 +19,17 @@
-- "not classified by the winning implementation" rather than losing the column
-- outright.
-alter table mcp_client_sessions
- alter column client drop not null;
-
-alter table mcp_client_daily
- alter column client drop not null;
+-- Databases where the second migration created the tables first never had a
+-- `client` column (they carry client_name/client_version instead), so each
+-- statement only runs when the legacy column exists.
+do $$
+begin
+ if exists (select 1 from information_schema.columns
+ where table_schema = current_schema() and table_name = 'mcp_client_sessions' and column_name = 'client') then
+ alter table mcp_client_sessions alter column client drop not null;
+ end if;
+ if exists (select 1 from information_schema.columns
+ where table_schema = current_schema() and table_name = 'mcp_client_daily' and column_name = 'client') then
+ alter table mcp_client_daily alter column client drop not null;
+ end if;
+end $$;