diff --git a/libs/checkpoint-postgres/langgraph/store/postgres/base.py b/libs/checkpoint-postgres/langgraph/store/postgres/base.py index d6035bb70..338f5e890 100644 --- a/libs/checkpoint-postgres/langgraph/store/postgres/base.py +++ b/libs/checkpoint-postgres/langgraph/store/postgres/base.py @@ -79,12 +79,12 @@ CREATE INDEX CONCURRENTLY IF NOT EXISTS store_prefix_idx ON store USING btree (p """ -- Add expires_at column to store table ALTER TABLE store -ADD COLUMN expires_at TIMESTAMP WITH TIME ZONE, -ADD COLUMN ttl_minutes INT; +ADD COLUMN IF NOT EXISTS expires_at TIMESTAMP WITH TIME ZONE, +ADD COLUMN IF NOT EXISTS ttl_minutes INT; """, """ -- Add indexes for efficient TTL sweeping -CREATE INDEX idx_store_expires_at ON store (expires_at) +CREATE INDEX IF NOT EXISTS idx_store_expires_at ON store (expires_at) WHERE expires_at IS NOT NULL; """, ] diff --git a/libs/checkpoint-postgres/pyproject.toml b/libs/checkpoint-postgres/pyproject.toml index 0d9ac1c12..7c727163a 100644 --- a/libs/checkpoint-postgres/pyproject.toml +++ b/libs/checkpoint-postgres/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint-postgres" -version = "2.0.17" +version = "2.0.18" description = "Library with a Postgres implementation of LangGraph checkpoint saver." authors = [] license = "MIT"