Seed templates

This commit is contained in:
1ilit
2024-02-28 22:47:07 +02:00
parent d3625dd980
commit 141b303e50
12 changed files with 2218 additions and 1604 deletions

View File

@@ -2,9 +2,219 @@ export const template1 = {
tables: [
{
id: 0,
name: "table_0",
x: 23,
y: 26,
name: "users",
x: 114.92525,
y: 281.2977500000002,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "username",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "password",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: 255,
},
{
name: "email",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
},
{
name: "last_login",
type: "TIMESTAMP",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
values: [],
},
],
comment: "",
indices: [],
color: "#6360f7",
},
{
id: 1,
name: "blog_posts",
x: 277.57925,
y: 19.206750000000113,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "user_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "title",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: 255,
},
{
name: "content",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
},
{
name: "cover",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: 255,
},
],
comment: "",
indices: [],
color: "#bc49c4",
},
{
id: 2,
name: "comments",
x: 505.62112500000035,
y: 341.6078750000002,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "blog_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "user_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
{
name: "content",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 3,
name: "tags",
x: 743.2832500000009,
y: 318.1841250000001,
fields: [
{
name: "id",
@@ -34,122 +244,131 @@ export const template1 = {
],
comment: "",
indices: [],
color: "#175e7a",
color: "#7d9dff",
},
{
id: 1,
name: "table_1",
x: 301,
y: 167,
id: 4,
name: "blog_tag",
x: 812.1175000000004,
y: 131.55062500000008,
fields: [
{
name: "id",
name: "blog_id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 0,
},
{
name: "age",
name: "tag_id",
type: "INT",
default: "",
check: "",
primary: false,
primary: true,
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",
color: "#ffe159",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
startFieldId: 1,
endTableId: 0,
endFieldId: 0,
startX: 316,
startY: 308,
endX: 38,
endY: 95,
name: "table_1_t_id_fk",
cardinality: "One to one",
startX: 292.57925,
startY: 124.20675000000011,
endX: 129.92525,
endY: 350.2977500000002,
name: "blog_posts_user_id_fk",
cardinality: "Many 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",
startTableId: 2,
startFieldId: 1,
endTableId: 1,
endFieldId: 0,
startX: 520.6211250000003,
startY: 446.6078750000002,
endX: 292.57925,
endY: 88.20675000000011,
name: "comments_blog_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
{
startTableId: 2,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 520.6211250000003,
startY: 482.6078750000002,
endX: 129.92525,
endY: 350.2977500000002,
name: "comments_user_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 2,
},
{
startTableId: 4,
startFieldId: 1,
endTableId: 3,
endFieldId: 0,
startX: 827.1175000000004,
startY: 236.55062500000008,
endX: 758.2832500000009,
endY: 387.1841250000001,
name: "blog_tag_tag_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 3,
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 1,
endFieldId: 0,
startX: 827.1175000000004,
startY: 200.55062500000008,
endX: 292.57925,
endY: 88.20675000000011,
name: "blog_tag_blog_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 4,
},
],
notes: [],
subjectAreas: [],
types: [],
title: "Template 1",
title: "Blog database schema",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
"A blog database including tables such as posts, users, comments, and tags to facilitate the storage and retrieval of blog-related information.",
custom: 0,
};