Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Add title to json and ddb export

1ilit3ab820d7ee88
diff --git a/src/components/ControlPanel.jsx b/src/components/ControlPanel.jsx
index 896da7eb..0c735383 100644
--- a/src/components/ControlPanel.jsx
+++ b/src/components/ControlPanel.jsx
@@ -163,6 +163,9 @@ export default function ControlPanel({
setRelationships(data.relationships);
setAreas(data.subjectAreas);
setNotes(data.notes);
+ if (data.title) {
+ setTitle(data.title);
+ }
};
const undo = () => {
@@ -880,6 +883,7 @@ export default function ControlPanel({
notes: notes,
subjectAreas: areas,
types: types,
+ title: title,
},
null,
2
@@ -931,7 +935,7 @@ export default function ControlPanel({
const result = JSON.stringify(
{
author: "Unnamed",
- filename: title,
+ title: title,
date: new Date().toISOString(),
tables: tables,
relationships: relationships,
diff --git a/src/data/schemas.js b/src/data/schemas.js
index dbb1b109..fd75448c 100644
--- a/src/data/schemas.js
+++ b/src/data/schemas.js
@@ -161,6 +161,7 @@ const jsonSchema = {
type: "array",
items: { ...areaSchema },
},
+ title: { type: "string" },
},
required: ["tables", "relationships", "notes", "subjectAreas"],
};
@@ -170,7 +171,7 @@ const ddbSchema = {
properties: {
author: { type: "string" },
project: { type: "string" },
- filename: { type: "string" },
+ title: { type: "string" },
date: { type: "string" },
...jsonSchema.properties,
},