Seed templates

This commit is contained in:
1ilit 2023-12-12 01:14:29 +02:00
parent 705251a275
commit 503d55b528
10 changed files with 2197 additions and 382 deletions

View File

@ -1,335 +1,21 @@
const t1 = { import { template1 } from "../templates/template1";
tables: [ import { template2 } from "../templates/template2";
{ import { template3 } from "../templates/template3";
id: 0, import { template4 } from "../templates/template4";
name: "table_0", import { template5 } from "../templates/template5";
x: 73, import { template6 } from "../templates/template6";
y: 69, import { template7 } from "../templates/template7";
fields: [ import { template8 } from "../templates/template8";
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 1,
name: "table_1",
x: 366,
y: 117,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
],
relationships: [
{
startTableId: 0,
startFieldId: 0,
endTableId: 1,
endFieldId: 0,
startX: 88,
startY: 138,
endX: 381,
endY: 186,
name: "table_0_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
],
notes: [
{
id: 0,
x: 526,
y: 240,
title: "note_0",
content: "hi",
color: "#fcf7ac",
height: 65,
},
],
subjectAreas: [
{
id: 0,
name: "area_0",
x: 43,
y: 28,
width: 558,
height: 206,
color: "#175e7a",
},
],
types: [],
title: "Template 1",
description: "Lorem ipsum",
};
const t2 = { const templateSeeds = [
tables: [ template1,
{ template2,
id: 0, template3,
name: "template_2", template4,
x: 57, template5,
y: 63, template6,
fields: [ template7,
{ template8,
name: "id", ];
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#ff4f81",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 2",
description: "Lorem ipsum",
};
const t3 = {
tables: [
{
id: 0,
name: "template_3",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#bc49c4",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 3",
description: "Lorem ipsum",
};
const t4 = {
tables: [
{
id: 0,
name: "template_4",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#a751e8",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 4",
description: "Lorem ipsum",
};
const t5 = {
tables: [
{
id: 0,
name: "template_5",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 5",
description: "Lorem ipsum",
};
const t6 = {
tables: [
{
id: 0,
name: "template_6",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#6360f7",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 6",
description: "Lorem ipsum",
};
const t7 = {
tables: [
{
id: 0,
name: "template_7",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 7",
description: "Lorem ipsum",
};
const t8 = {
tables: [
{
id: 0,
name: "template_8",
x: 57,
y: 63,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#32c9b0",
},
],
relationships: [],
notes: [],
subjectAreas: [],
types: [],
title: "Template 8",
description: "Lorem ipsum",
};
const templateSeeds = [t1, t2, t3, t4, t5, t6, t7, t8];
export { templateSeeds }; export { templateSeeds };

View File

@ -9,8 +9,8 @@ import { calcPath } from "../utils";
function Thumbnail({ diagram }) { function Thumbnail({ diagram }) {
const zoom = 0.3; const zoom = 0.3;
return ( return (
<div className="w-full select-none"> <div className="w-full select-none h-[190px]">
<svg className="bg-white w-full"> <svg className="bg-white w-full h-full rounded-t-md">
<defs> <defs>
<pattern <pattern
id="pattern-circles" id="pattern-circles"
@ -80,7 +80,9 @@ function Thumbnail({ diagram }) {
</div> </div>
{table.fields.map((f, j) => ( {table.fields.map((f, j) => (
<div <div
className="flex justify-between items-center py-[2px] px-[3px]" className={`flex justify-between items-center py-[2px] px-[3px] ${
j < table.fields.length - 1 ? "border-b" : ""
}`}
key={j} key={j}
> >
<div className="flex items-center justify-start"> <div className="flex items-center justify-start">
@ -164,6 +166,7 @@ export default function Templates() {
return ( return (
<div> <div>
<div className="min-h-screen">
<div className="sm:py-3 py-5 px-12 xl:px-20 sm:px-6 flex justify-between items-center select-none"> <div className="sm:py-3 py-5 px-12 xl:px-20 sm:px-6 flex justify-between items-center select-none">
<div className="flex items-center justify-start"> <div className="flex items-center justify-start">
<Link to="/"> <Link to="/">
@ -185,8 +188,8 @@ export default function Templates() {
Database schema templates Database schema templates
</div> </div>
<div className="text-sm text-neutral-700"> <div className="text-sm text-neutral-700">
A compilation of database entity relationship diagrams to give you a A compilation of database entity relationship diagrams to give you
quick start or inspire your application's architecture. a quick start or inspire your application's architecture.
</div> </div>
</div> </div>
<Tabs> <Tabs>
@ -198,12 +201,21 @@ export default function Templates() {
{templates?.map((t, i) => ( {templates?.map((t, i) => (
<div <div
key={i} key={i}
className="p-4 bg-gray-200 hover:translate-y-[-6px] transition-all duration-300" className="bg-gray-100 hover:translate-y-[-6px] transition-all duration-300 border rounded-md"
> >
<Thumbnail diagram={t} /> <Thumbnail diagram={t} />
<div>{t.title}</div> <div className="px-4 py-3">
<div className="flex justify-between">
<div className="text-lg font-bold text-zinc-700">
{t.title}
</div>
<button className="border rounded px-2 py-1 bg-white hover:bg-gray-200 transition-all duration-300">
<i className="fa-solid fa-code-fork"></i>
</button>
</div>
<div>{t.description}</div> <div>{t.description}</div>
</div> </div>
</div>
))} ))}
</div> </div>
</TabPane> </TabPane>
@ -211,10 +223,15 @@ export default function Templates() {
tab={<span className="mx-2">Your templates</span>} tab={<span className="mx-2">Your templates</span>}
itemKey="2" itemKey="2"
> >
Your templates <div className=" flex flex-col h-full">Your templates</div>
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>
</div> </div>
<hr className="border-zinc-300 my-1" />
<div className="text-center text-sm py-3">
&copy; 2024 <strong>drawDB</strong> - All right reserved.
</div>
</div>
); );
} }

154
src/templates/template1.js Normal file
View File

@ -0,0 +1,154 @@
export const template1 = {
tables: [
{
id: 0,
name: "table_0",
x: 23,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 1,
name: "table_1",
x: 301,
y: 167,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 2,
name: "table_2",
x: 594,
y: 232,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 316,
startY: 308,
endX: 38,
endY: 95,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
],
notes: [
{
id: 0,
x: 352,
y: 22,
title: "note_0",
content: "hi",
color: "#fcf7ac",
height: 65,
},
],
subjectAreas: [
{
id: 0,
name: "area_0",
x: 0,
y: 0,
width: 562,
height: 390,
color: "#175e7a",
},
],
types: [],
title: "Template 1",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

163
src/templates/template2.js Normal file
View File

@ -0,0 +1,163 @@
export const template2 = {
tables: [
{
id: 0,
name: "table_0",
x: 23,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 1,
name: "table_1",
x: 30,
y: 178,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 2,
name: "table_2",
x: 336,
y: 118,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 45,
startY: 319,
endX: 38,
endY: 95,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
],
notes: [
{
id: 0,
x: 352,
y: 22,
title: "note_0",
content: "hi",
color: "#fcf7ac",
height: 65,
},
{
id: 1,
x: 577,
y: 254,
title: "note_1",
content: "",
color: "#c7d2ff",
height: 88,
},
],
subjectAreas: [
{
id: 0,
name: "area_0",
x: -10,
y: -22,
width: 562,
height: 390,
color: "#7c4af0",
},
],
types: [],
title: "Template 2",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

230
src/templates/template3.js Normal file
View File

@ -0,0 +1,230 @@
export const template3 = {
tables: [
{
id: 0,
name: "table_0",
x: 23,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 1,
name: "table_1",
x: 354,
y: 144,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 2,
name: "table_2",
x: 25,
y: 171,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_3",
x: 356,
y: 30,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 4,
name: "table_4",
x: 628,
y: 6,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 369,
startY: 285,
endX: 38,
endY: 95,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
],
notes: [
{
id: 0,
x: 630,
y: 164,
title: "note_0",
content: "hi",
color: "#fcf7ac",
height: 65,
},
{
id: 1,
x: 635,
y: 260,
title: "note_1",
content: "",
color: "#c7d2ff",
height: 88,
},
],
subjectAreas: [
{
id: 0,
name: "area_0",
x: -10,
y: -22,
width: 264,
height: 365,
color: "#7c4af0",
},
{
id: 1,
name: "area_1",
x: 289,
y: -18,
width: 303,
height: 392,
color: "#175e7a",
},
],
types: [],
title: "Template 3",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

310
src/templates/template4.js Normal file
View File

@ -0,0 +1,310 @@
export const template4 = {
tables: [
{
id: 0,
name: "table_0",
x: 23,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 1,
name: "table_1",
x: 21,
y: 281,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 2,
name: "table_2",
x: 25,
y: 171,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_3",
x: 258,
y: 28,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 4,
name: "table_4",
x: 262,
y: 140,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 5,
name: "table_5",
x: 552,
y: 333,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
{
id: 6,
name: "table_6",
x: 553,
y: 127,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#a751e8",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 36,
startY: 422,
endX: 38,
endY: 95,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
endFieldId: 0,
startX: 277,
startY: 209,
endX: 567,
endY: 402,
name: "table_4_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
],
notes: [
{
id: 0,
x: 558,
y: 21,
title: "note_0",
content: "hi",
color: "#fcf7ac",
height: 65,
},
{
id: 1,
x: 268,
y: 308,
title: "note_1",
content: "",
color: "#c7d2ff",
height: 88,
},
],
subjectAreas: [
{
id: 0,
name: "area_0",
x: -10,
y: -9,
width: 855,
height: 471,
color: "#7d9dff",
},
],
types: [],
title: "Template 4",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

268
src/templates/template5.js Normal file
View File

@ -0,0 +1,268 @@
export const template5 = {
tables: [
{
id: 0,
name: "table_0",
x: 55,
y: 51,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 1,
name: "table_1",
x: 325,
y: 57,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 2,
name: "table_2",
x: 52,
y: 191,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_4",
x: 582,
y: 11,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 4,
name: "table_5",
x: 584,
y: 337,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
{
id: 5,
name: "table_6",
x: 579,
y: 153,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#a751e8",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 340,
startY: 198,
endX: 70,
endY: 120,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
endFieldId: 0,
startX: 599,
startY: 406,
endX: 594,
endY: 222,
name: "table_4_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
],
notes: [],
subjectAreas: [
{
id: 0,
name: "area_0",
x: 24,
y: 10,
width: 533,
height: 291,
color: "#32c9b0",
},
],
types: [],
title: "Template 5",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

304
src/templates/template6.js Normal file
View File

@ -0,0 +1,304 @@
export const template6 = {
tables: [
{
id: 0,
name: "table_0",
x: 55,
y: 23,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 1,
name: "table_1",
x: 322,
y: 145,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 2,
name: "table_2",
x: 59,
y: 171,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_4",
x: 580,
y: 28,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 4,
name: "table_5",
x: 324,
y: 338,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
{
id: 5,
name: "table_6",
x: 62,
y: 287,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#a751e8",
},
{
id: 6,
name: "table_6",
x: 580,
y: 182,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 7,
name: "table_7",
x: 321,
y: 25,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 337,
startY: 286,
endX: 70,
endY: 92,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
endFieldId: 0,
startX: 339,
startY: 407,
endX: 77,
endY: 356,
name: "table_4_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
],
notes: [],
subjectAreas: [],
types: [],
title: "Template 6",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

314
src/templates/template7.js Normal file
View File

@ -0,0 +1,314 @@
export const template7 = {
tables: [
{
id: 0,
name: "table_0",
x: 55,
y: 23,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#f03c3c",
},
{
id: 1,
name: "table_1",
x: 330,
y: 147,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 2,
name: "table_2",
x: 576,
y: 311,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_4",
x: 580,
y: 28,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#ff9159",
},
{
id: 4,
name: "table_5",
x: 324,
y: 338,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
{
id: 5,
name: "table_6",
x: 58,
y: 284,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#ff4f81",
},
{
id: 6,
name: "table_6",
x: 580,
y: 182,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 7,
name: "table_7",
x: 324,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 345,
startY: 288,
endX: 70,
endY: 92,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
endFieldId: 0,
startX: 339,
startY: 407,
endX: 73,
endY: 353,
name: "table_4_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
],
notes: [
{
id: 0,
x: 60,
y: 181,
title: "note_0",
content: "bruh",
color: "#fcf7ac",
height: 65,
},
],
subjectAreas: [],
types: [],
title: "Template 7",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};

369
src/templates/template8.js Normal file
View File

@ -0,0 +1,369 @@
export const template8 = {
tables: [
{
id: 0,
name: "table_0",
x: 55,
y: 23,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
],
comment: "",
indices: [],
color: "#f03c3c",
},
{
id: 1,
name: "table_1",
x: 331,
y: 147,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "age",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "t_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 2,
name: "table_2",
x: 57,
y: 171,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7c4af0",
},
{
id: 3,
name: "table_4",
x: 580,
y: 28,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "quantity",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
],
comment: "",
indices: [],
color: "#ff9159",
},
{
id: 4,
name: "table_5",
x: 324,
y: 338,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#7d9dff",
},
{
id: 5,
name: "table_6",
x: 58,
y: 284,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#ff4f81",
},
{
id: 6,
name: "table_3",
x: 580,
y: 182,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 7,
name: "table_7",
x: 324,
y: 26,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
],
comment: "",
indices: [],
color: "#175e7a",
},
{
id: 8,
name: "table_8",
x: 575,
y: 297,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "field1",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: "",
},
{
name: "field2",
type: "DOUBLE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
},
],
comment: "",
indices: [],
color: "#ffe159",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 346,
startY: 288,
endX: 70,
endY: 92,
name: "table_1_t_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
endFieldId: 0,
startX: 339,
startY: 407,
endX: 73,
endY: 353,
name: "table_4_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
{
startTableId: 6,
startFieldId: 0,
endTableId: 8,
endFieldId: 0,
startX: 595,
startY: 251,
endX: 590,
endY: 366,
name: "table_3_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 2,
},
],
notes: [],
subjectAreas: [],
types: [],
title: "Template 8",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
};