Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(rnd): Add creation & update time for AgentGraphExecutionSchedule, AgentGraphExecution, and AgentGraph (#8015)

Zamil Majdyb1b31390a44f
diff --git a/rnd/autogpt_server/migrations/20240906155206_add_created_at_updated_at/migration.sql b/rnd/autogpt_server/migrations/20240906155206_add_created_at_updated_at/migration.sql
new file mode 100644
index 0000000000..cb3962035b
--- /dev/null
+++ b/rnd/autogpt_server/migrations/20240906155206_add_created_at_updated_at/migration.sql
@@ -0,0 +1,11 @@
+-- AlterTable
+ALTER TABLE "AgentGraph" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ADD COLUMN "updatedAt" TIMESTAMP(3);
+
+-- AlterTable
+ALTER TABLE "AgentGraphExecution" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ADD COLUMN "updatedAt" TIMESTAMP(3);
+
+-- AlterTable
+ALTER TABLE "AgentGraphExecutionSchedule" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ADD COLUMN "updatedAt" TIMESTAMP(3);
diff --git a/rnd/autogpt_server/migrations/migration_lock.toml b/rnd/autogpt_server/migrations/migration_lock.toml
new file mode 100644
index 0000000000..fbffa92c2b
--- /dev/null
+++ b/rnd/autogpt_server/migrations/migration_lock.toml
@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (i.e. Git)
+provider = "postgresql"
\ No newline at end of file
diff --git a/rnd/autogpt_server/schema.prisma b/rnd/autogpt_server/schema.prisma
index f06f060091..014ea43922 100644
--- a/rnd/autogpt_server/schema.prisma
+++ b/rnd/autogpt_server/schema.prisma
@@ -31,6 +31,8 @@ model User {
model AgentGraph {
id String @default(uuid())
version Int @default(1)
+ createdAt DateTime @default(now())
+ updatedAt DateTime? @updatedAt
name String?
description String?
@@ -114,6 +116,8 @@ model AgentBlock {
// This model describes the execution of an AgentGraph.
model AgentGraphExecution {
id String @id @default(uuid())
+ createdAt DateTime @default(now())
+ updatedAt DateTime? @updatedAt
agentGraphId String
agentGraphVersion Int @default(1)
@@ -175,6 +179,8 @@ model AgentNodeExecutionInputOutput {
// This model describes the recurring execution schedule of an Agent.
model AgentGraphExecutionSchedule {
id String @id
+ createdAt DateTime @default(now())
+ updatedAt DateTime? @updatedAt
agentGraphId String
agentGraphVersion Int @default(1)