mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix(db): make databases.agent_id and agent_database_id nullable for soft-delete
This commit is contained in:
@@ -23,7 +23,7 @@ export const DatabaseCard = (props: DatabaseCardProps) => {
|
||||
const handleCopy = (e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
navigator.clipboard.writeText(database.agentDatabaseId);
|
||||
navigator.clipboard.writeText(database.agentDatabaseId ?? "");
|
||||
setIsCopied(true);
|
||||
setTimeout(() => setIsCopied(false), 2000);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "databases" ALTER COLUMN "agent_database_id" DROP NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "databases" ALTER COLUMN "agent_id" DROP NOT NULL;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -491,6 +491,13 @@
|
||||
"when": 1782937885439,
|
||||
"tag": "0069_worried_alex_wilder",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 70,
|
||||
"version": "7",
|
||||
"when": 1783264084846,
|
||||
"tag": "0070_illegal_joseph",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import {JobLog, jobLog} from "@/db/schema/17_job-log";
|
||||
|
||||
export const database = pgTable("databases", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
agentDatabaseId: uuid("agent_database_id").notNull().defaultRandom(),
|
||||
agentDatabaseId: uuid("agent_database_id").defaultRandom(),
|
||||
name: text("name").notNull(),
|
||||
dbms: dbmsEnum("dbms").notNull(),
|
||||
description: text("description"),
|
||||
@@ -22,7 +22,6 @@ export const database = pgTable("databases", {
|
||||
backupToRestore: text("backup_to_restore"),
|
||||
healthErrorCount: integer("health_error_count"),
|
||||
agentId: uuid("agent_id")
|
||||
.notNull()
|
||||
.references(() => agent.id, {onDelete: "cascade"}),
|
||||
lastContact: timestamp("last_contact"),
|
||||
projectId: uuid("project_id")
|
||||
|
||||
Reference in New Issue
Block a user