mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Adding the Edit/creation for agent.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[slug]` on the table `Agent` will be added. If there are existing duplicate values, this will fail.
|
||||
- Added the required column `slug` to the `Agent` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Agent" ADD COLUMN "slug" TEXT NOT NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Agent_slug_key" ON "Agent"("slug");
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Database" ADD CONSTRAINT "Database_agent_id_fkey" FOREIGN KEY ("agent_id") REFERENCES "Agent"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -72,16 +72,20 @@ model User {
|
||||
}
|
||||
|
||||
model Agent {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
slug String @unique
|
||||
name String
|
||||
description String?
|
||||
lastContact DateTime? @map("last_contact")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
lastContact DateTime? @map("last_contact")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
databases Database[]
|
||||
}
|
||||
|
||||
model Database {
|
||||
id String @id @default(cuid())
|
||||
agentId String @map("agent_id")
|
||||
id String @id @default(cuid())
|
||||
agentId String @map("agent_id")
|
||||
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
||||
|
||||
name String
|
||||
description String?
|
||||
backupPolicy String? @map("backup_policy")
|
||||
|
||||
Reference in New Issue
Block a user