drawDB/src/templates/template4.js

386 lines
7.8 KiB
JavaScript
Raw Normal View History

2023-12-12 07:14:29 +08:00
export const template4 = {
tables: [
{
id: 0,
2024-02-29 04:47:07 +08:00
name: "books",
x: 167,
y: 88,
2023-12-12 07:14:29 +08:00
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
2024-02-29 04:47:07 +08:00
name: "title",
2023-12-12 07:14:29 +08:00
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
2024-02-29 04:47:07 +08:00
name: "isbn",
type: "VARCHAR",
2023-12-12 07:14:29 +08:00
default: "",
check: "",
2024-02-29 04:47:07 +08:00
primary: false,
unique: false,
notNull: false,
increment: false,
2023-12-12 07:14:29 +08:00
comment: "",
2024-02-29 04:47:07 +08:00
id: 2,
size: 255,
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
name: "author_id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
2024-02-29 04:47:07 +08:00
id: 3,
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
name: "genre_id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
2024-02-29 04:47:07 +08:00
id: 4,
2023-12-12 07:14:29 +08:00
},
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#6360f7",
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
id: 1,
name: "genres",
x: 78,
y: 379,
2023-12-12 07:14:29 +08:00
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
2024-02-29 04:47:07 +08:00
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
2023-12-12 07:14:29 +08:00
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#bc49c4",
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
id: 2,
name: "authors",
x: 475,
y: 342,
2023-12-12 07:14:29 +08:00
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
2024-02-29 04:47:07 +08:00
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "birthday",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: [],
},
{
name: "nationality",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
},
2023-12-12 07:14:29 +08:00
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#ffe159",
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
id: 3,
name: "reservations",
x: 501,
y: 14,
2023-12-12 07:14:29 +08:00
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
2024-02-29 04:47:07 +08:00
name: "book_id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
2024-02-29 04:47:07 +08:00
name: "patron_id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
2024-02-29 04:47:07 +08:00
primary: false,
unique: false,
notNull: false,
increment: false,
2023-12-12 07:14:29 +08:00
comment: "",
2024-02-29 04:47:07 +08:00
id: 2,
},
{
name: "date",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
values: [],
},
{
name: "email",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: 255,
2023-12-12 07:14:29 +08:00
},
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#89e667",
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
id: 4,
name: "patrons",
x: 780,
y: 220,
2023-12-12 07:14:29 +08:00
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
2024-02-29 04:47:07 +08:00
name: "name",
2023-12-12 07:14:29 +08:00
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
2024-02-29 04:47:07 +08:00
name: "email",
type: "VARCHAR",
2023-12-12 07:14:29 +08:00
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
2024-02-29 04:47:07 +08:00
size: 255,
},
{
name: "phone",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
2023-12-12 07:14:29 +08:00
},
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#ff9159",
2023-12-12 07:14:29 +08:00
},
],
relationships: [
{
2024-02-29 04:47:07 +08:00
startTableId: 0,
startFieldId: 3,
endTableId: 2,
2023-12-12 07:14:29 +08:00
endFieldId: 0,
2024-02-29 04:47:07 +08:00
startX: 182,
startY: 265,
endX: 490,
endY: 411,
name: "books_author_id_fk",
cardinality: "Many to one",
2023-12-12 07:14:29 +08:00
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 0,
},
{
2024-02-29 04:47:07 +08:00
startTableId: 3,
startFieldId: 1,
endTableId: 0,
2023-12-12 07:14:29 +08:00
endFieldId: 0,
2024-02-29 04:47:07 +08:00
startX: 516,
startY: 119,
endX: 182,
endY: 157,
name: "reservations_book_id_fk",
2023-12-12 07:14:29 +08:00
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
},
{
2024-02-29 04:47:07 +08:00
startTableId: 3,
startFieldId: 2,
endTableId: 4,
endFieldId: 0,
startX: 516,
startY: 155,
endX: 795,
endY: 289,
name: "reservations_patron_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 2,
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
startTableId: 0,
startFieldId: 4,
endTableId: 1,
endFieldId: 0,
startX: 182,
startY: 301,
endX: 93,
endY: 448,
name: "books_genre_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 3,
2023-12-12 07:14:29 +08:00
},
],
2024-02-29 04:47:07 +08:00
notes: [],
subjectAreas: [],
2023-12-12 07:14:29 +08:00
types: [],
2024-02-29 04:47:07 +08:00
title: "Library schema",
2023-12-12 07:14:29 +08:00
description:
2024-02-29 04:47:07 +08:00
"A library schema designed to manage the books, genres, reservations, and other aspects of a library system",
2023-12-19 10:36:10 +08:00
custom: 0,
2023-12-12 07:14:29 +08:00
};