Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: derive sync_sequence name dynamically in trigger function

Adam Eivy52f90bd76b52
diff --git a/server/scripts/init-db.sql b/server/scripts/init-db.sql
index 3dff702e30..a06313ce24 100644
--- a/server/scripts/init-db.sql
+++ b/server/scripts/init-db.sql
@@ -98,7 +98,7 @@ BEGIN
IF NEW.updated_at IS NULL OR NEW.updated_at = OLD.updated_at THEN
NEW.updated_at := NOW();
END IF;
- NEW.sync_sequence := nextval('memories_sync_sequence_seq');
+ NEW.sync_sequence := nextval(pg_get_serial_sequence('memories', 'sync_sequence'));
RETURN NEW;
END;
$$ LANGUAGE plpgsql;