Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/database/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ class AgentInfo(TableBase):
__tablename__ = "ag_tenant_agent_t"
__table_args__ = {"schema": SCHEMA}

agent_id = Column(Integer, nullable=False, primary_key=True, autoincrement=True, doc="ID")
agent_id = Column(Integer, Sequence(
"ag_tenant_agent_t_agent_id_seq", schema=SCHEMA), nullable=False, primary_key=True, autoincrement=True, doc="ID")
version_no = Column(Integer, default=0, nullable=False, primary_key=True, doc="Version number. 0 = draft/editing state, >=1 = published snapshot")
name = Column(String(100), doc="Agent name")
display_name = Column(String(100), doc="Agent display name")
Expand Down
2 changes: 1 addition & 1 deletion docker/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ COMMENT ON COLUMN nexent.ag_tool_info_t.delete_flag IS 'Whether it is deleted. O

-- Create the ag_tenant_agent_t table in the nexent schema
CREATE TABLE IF NOT EXISTS nexent.ag_tenant_agent_t (
agent_id INTEGER NOT NULL,
agent_id SERIAL INTEGER NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里直接写SERIAL就行了哟,在 PG 里,SERIAL 本身就已经是一个伪类型(pseudo-type),内部已经包含了 INTEGER,不能再写 INTEGER。

name VARCHAR(100),
display_name VARCHAR(100),
description VARCHAR,
Expand Down
6 changes: 6 additions & 0 deletions docker/sql/v1.8.1_0224_init_agent_id_seq.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE SEQUENCE IF NOT EXISTS "nexent"."ag_tenant_agent_t_agent_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
Loading