Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: Remove bad unique constraint on archives (#3715)

Matthew Zhou62bb5ee7669b
diff --git a/alembic/versions/74e860718e0d_add_archival_memory_sharing.py b/alembic/versions/74e860718e0d_add_archival_memory_sharing.py
index 1c009cfdd..567b8061b 100644
--- a/alembic/versions/74e860718e0d_add_archival_memory_sharing.py
+++ b/alembic/versions/74e860718e0d_add_archival_memory_sharing.py
@@ -52,7 +52,6 @@ def upgrade() -> None:
["organizations.id"],
),
sa.PrimaryKeyConstraint("id"),
- sa.UniqueConstraint("name", "organization_id", name="unique_archive_name_per_org"),
)
else:
# Check if archives table already exists
@@ -87,7 +86,6 @@ def upgrade() -> None:
["organizations.id"],
),
sa.PrimaryKeyConstraint("id"),
- sa.UniqueConstraint("name", "organization_id", name="unique_archive_name_per_org"),
)
op.create_index("ix_archives_created_at", "archives", ["created_at", "id"], unique=False)
diff --git a/letta/orm/archive.py b/letta/orm/archive.py
index e8d89f634..67badc013 100644
--- a/letta/orm/archive.py
+++ b/letta/orm/archive.py
@@ -2,7 +2,7 @@ import uuid
from datetime import datetime, timezone
from typing import TYPE_CHECKING, List, Optional
-from sqlalchemy import JSON, Index, String, UniqueConstraint
+from sqlalchemy import JSON, Index, String
from sqlalchemy.orm import Mapped, mapped_column, relationship
from letta.orm.mixins import OrganizationMixin
@@ -26,7 +26,6 @@ class Archive(SqlalchemyBase, OrganizationMixin):
__pydantic_model__ = PydanticArchive
__table_args__ = (
- UniqueConstraint("name", "organization_id", name="unique_archive_name_per_org"),
Index("ix_archives_created_at", "created_at", "id"),
Index("ix_archives_organization_id", "organization_id"),
)