Skip to content

Commit d5dd071

Browse files
authored
Release/v1.8.0.1 hotfix
Release/v1.8.0.1 hotfix
2 parents b99e36f + 23a3ed8 commit d5dd071

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

backend/database/db_models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,12 @@ class ToolInstance(TableBase):
236236
__table_args__ = {"schema": SCHEMA}
237237

238238
tool_instance_id = Column(
239-
Integer, primary_key=True, nullable=False, doc="ID")
239+
Integer,
240+
Sequence("ag_tool_instance_t_tool_instance_id_seq", schema=SCHEMA),
241+
primary_key=True,
242+
nullable=False,
243+
doc="ID"
244+
)
240245
tool_id = Column(Integer, doc="Tenant tool ID")
241246
agent_id = Column(Integer, doc="Agent ID")
242247
params = Column(JSON, doc="Parameter configuration")
@@ -351,7 +356,7 @@ class AgentRelation(TableBase):
351356
__tablename__ = "ag_agent_relation_t"
352357
__table_args__ = {"schema": SCHEMA}
353358

354-
relation_id = Column(Integer, primary_key=True, autoincrement=True, nullable=False, doc="Relationship ID, primary key")
359+
relation_id = Column(Integer, Sequence("ag_agent_relation_t_relation_id_seq", schema=SCHEMA), primary_key=True, nullable=False, doc="Relationship ID, primary key")
355360
selected_agent_id = Column(Integer, primary_key=True, doc="Selected agent ID")
356361
parent_agent_id = Column(Integer, doc="Parent agent ID")
357362
tenant_id = Column(String(100), doc="Tenant ID")

docker/init.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ WHERE delete_flag = 'N';
380380

381381
-- Create the ag_tool_instance_t table in the nexent schema
382382
CREATE TABLE IF NOT EXISTS nexent.ag_tool_instance_t (
383-
tool_instance_id INTEGER NOT NULL,
383+
tool_instance_id SERIAL NOT NULL,
384384
tool_id INTEGER,
385385
agent_id INTEGER,
386386
params JSON,
@@ -564,7 +564,7 @@ COMMENT ON COLUMN nexent.user_tenant_t.delete_flag IS 'Delete flag, Y/N';
564564

565565
-- Create the ag_agent_relation_t table in the nexent schema
566566
CREATE TABLE IF NOT EXISTS nexent.ag_agent_relation_t (
567-
relation_id INTEGER NOT NULL,
567+
relation_id SERIAL NOT NULL,
568568
selected_agent_id INTEGER,
569569
parent_agent_id INTEGER,
570570
tenant_id VARCHAR(100),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Step 1: Create sequence for auto-increment
2+
CREATE SEQUENCE IF NOT EXISTS "nexent"."ag_tool_instance_t_tool_instance_id_seq"
3+
INCREMENT 1
4+
MINVALUE 1
5+
MAXVALUE 2147483647
6+
START 1
7+
CACHE 1;
8+
9+
CREATE SEQUENCE IF NOT EXISTS "nexent"."ag_agent_relation_t_relation_id_seq"
10+
INCREMENT 1
11+
MINVALUE 1
12+
MAXVALUE 2147483647
13+
START 1
14+
CACHE 1;

0 commit comments

Comments
 (0)