drawDB/src/templates/template2.js

374 lines
7.6 KiB
JavaScript
Raw Normal View History

2023-12-12 07:14:29 +08:00
export const template2 = {
tables: [
{
id: 0,
2024-02-29 04:47:07 +08:00
name: "employees",
x: 365,
y: 20,
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: "first_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: "last_name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: 255,
},
{
name: "dob",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
values: [],
},
{
name: "dep_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
},
{
name: "pos_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 5,
},
2023-12-12 07:14:29 +08:00
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#a751e8",
2023-12-12 07:14:29 +08:00
},
{
id: 1,
2024-02-29 04:47:07 +08:00
name: "department",
x: 41,
y: 59,
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,
},
],
comment: "",
indices: [],
color: "#6360f7",
},
{
id: 2,
name: "positions",
x: 37,
y: 284,
fields: [
{
name: "id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
2024-02-29 04:47:07 +08:00
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "name",
type: "VARCHAR",
default: "",
check: "",
2023-12-12 07:14:29 +08:00
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
2024-02-29 04:47:07 +08:00
size: 255,
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
name: "salary",
type: "DOUBLE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 3,
name: "projects",
x: 668,
y: 28,
fields: [
{
name: "id",
2023-12-12 07:14:29 +08:00
type: "INT",
default: "",
check: "",
2024-02-29 04:47:07 +08:00
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,
},
{
name: "description",
type: "TEXT",
default: "",
check: "",
2023-12-12 07:14:29 +08:00
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
2024-02-29 04:47:07 +08:00
size: 65535,
},
{
name: "start_date",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
values: [],
},
{
name: "end_date",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
values: [],
2023-12-12 07:14:29 +08:00
},
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#7d9dff",
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
id: 4,
name: "project_assignment",
x: 684,
y: 295,
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: "project_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "employee_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
2023-12-12 07:14:29 +08:00
],
comment: "",
indices: [],
2024-02-29 04:47:07 +08:00
color: "#32c9b0",
2023-12-12 07:14:29 +08:00
},
],
relationships: [
{
2024-02-29 04:47:07 +08:00
startTableId: 0,
startFieldId: 4,
endTableId: 1,
2023-12-12 07:14:29 +08:00
endFieldId: 0,
2024-02-29 04:47:07 +08:00
startX: 380,
startY: 233,
endX: 56,
endY: 128,
name: "employees_dep_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: 0,
startFieldId: 5,
endTableId: 2,
endFieldId: 0,
startX: 380,
startY: 269,
endX: 52,
endY: 353,
name: "employees_pos_id_fk",
cardinality: "One to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 1,
2023-12-12 07:14:29 +08:00
},
{
2024-02-29 04:47:07 +08:00
startTableId: 4,
startFieldId: 1,
endTableId: 3,
endFieldId: 0,
startX: 699,
startY: 400,
endX: 683,
endY: 97,
name: "project_assignment_project_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: 4,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 699,
startY: 436,
endX: 380,
endY: 89,
name: "project_assignment_employee_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: "Human resources schema",
2023-12-12 07:14:29 +08:00
description:
2024-02-29 04:47:07 +08:00
"A Human Resources (HR) schema designed to manage employee and project related information within an organization.",
2023-12-19 10:36:10 +08:00
custom: 0,
2023-12-12 07:14:29 +08:00
};