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,9 @@ export const template5 = {
tables: [
{
id: 0,
name: "table_0",
x: 55,
y: 51,
name: "accounts",
x: 129,
y: 92,
fields: [
{
name: "id",
@@ -19,43 +19,7 @@ export const template5 = {
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",
name: "customer_id",
type: "INT",
default: "",
check: "",
@@ -66,135 +30,6 @@ export const template5 = {
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",
@@ -206,27 +41,524 @@ export const template5 = {
increment: false,
comment: "",
id: 2,
values: ["checking", "savings"],
},
{
name: "number",
type: "BIGINT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
},
{
name: "balance",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
values: ["hi", "hello"],
},
],
comment: "",
indices: [],
color: "#a751e8",
color: "#7d9dff",
},
{
id: 1,
name: "customers",
x: 384,
y: 315,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "first_name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
size: 255,
},
{
name: "last_name",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: 255,
},
{
name: "phone",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: 255,
},
{
name: "address",
type: "VARCHAR",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: 255,
},
],
comment: "",
indices: [],
color: "#32c9b0",
},
{
id: 2,
name: "transactions",
x: 431,
y: 4,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "account_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "time",
type: "DATETIME",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
values: [],
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
values: ["withdrawal", "deposit"],
},
{
name: "amount",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
},
],
comment: "",
indices: [],
color: "#3cde7d",
},
{
id: 3,
name: "transfers",
x: 112,
y: 358,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "from",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "to",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
{
name: "time",
type: "DATETIME",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
values: [],
},
{
name: "amount",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
},
],
comment: "",
indices: [],
color: "#89e667",
},
{
id: 4,
name: "cards",
x: 772,
y: 29,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
values: ["visa", "master"],
},
{
name: "customer_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
},
{
name: "number",
type: "BIGINT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
},
{
name: "limit",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
},
],
comment: "",
indices: [],
color: "#ffe159",
},
{
id: 5,
name: "loans",
x: 919,
y: 281,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "customer_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "amount",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
size: "",
},
{
name: "rate",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
},
{
name: "term",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
values: [],
},
{
name: "status",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 5,
values: ["paid", "approved"],
},
],
comment: "",
indices: [],
color: "#ff9159",
},
{
id: 6,
name: "investments",
x: 664,
y: 395,
fields: [
{
name: "id",
type: "INT",
default: "",
check: "",
primary: true,
unique: true,
notNull: true,
increment: true,
comment: "",
id: 0,
},
{
name: "customer_id",
type: "INT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 1,
},
{
name: "type",
type: "ENUM",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 2,
values: ["mutual-fund", "stock"],
},
{
name: "amount",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 3,
size: "",
},
{
name: "date",
type: "DATE",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 4,
size: "",
values: [],
},
{
name: "current_val",
type: "FLOAT",
default: "",
check: "",
primary: false,
unique: false,
notNull: false,
increment: false,
comment: "",
id: 5,
size: "",
},
],
comment: "",
indices: [],
color: "#f03c3c",
},
],
relationships: [
{
startTableId: 1,
startFieldId: 2,
endTableId: 0,
startTableId: 0,
startFieldId: 1,
endTableId: 1,
endFieldId: 0,
startX: 340,
startY: 198,
endX: 70,
endY: 120,
name: "table_1_t_id_fk",
cardinality: "One to one",
startX: 144,
startY: 197,
endX: 399,
endY: 384,
name: "accounts_customer_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
@@ -234,36 +566,106 @@ export const template5 = {
},
{
startTableId: 4,
startFieldId: 0,
endTableId: 5,
startFieldId: 2,
endTableId: 1,
endFieldId: 0,
startX: 599,
startY: 406,
endX: 594,
endY: 222,
name: "table_4_id_fk",
cardinality: "One to one",
startX: 787,
startY: 170,
endX: 399,
endY: 384,
name: "cards_customer_id_fk",
cardinality: "Many 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",
startTableId: 5,
startFieldId: 1,
endTableId: 1,
endFieldId: 0,
startX: 934,
startY: 386,
endX: 399,
endY: 384,
name: "loans_customer_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 2,
},
{
startTableId: 6,
startFieldId: 1,
endTableId: 1,
endFieldId: 0,
startX: 679,
startY: 500,
endX: 399,
endY: 384,
name: "investments_customer_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 3,
},
{
startTableId: 2,
startFieldId: 1,
endTableId: 0,
endFieldId: 0,
startX: 446,
startY: 109,
endX: 144,
endY: 161,
name: "transactions_account_id_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 4,
},
{
startTableId: 3,
startFieldId: 2,
endTableId: 0,
endFieldId: 0,
startX: 127,
startY: 499,
endX: 144,
endY: 161,
name: "transfers_to_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 5,
},
{
startTableId: 3,
startFieldId: 1,
endTableId: 0,
endFieldId: 0,
startX: 127,
startY: 463,
endX: 144,
endY: 161,
name: "transfers_from_fk",
cardinality: "Many to one",
updateConstraint: "No action",
deleteConstraint: "No action",
mandatory: false,
id: 6,
},
],
notes: [],
subjectAreas: [],
types: [],
title: "Template 5",
title: "Bank schema",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam nulla illo pariatur nostrum.",
"A financial schema designed to manage financial transactions, accounts, customers, and other aspects of financial data.",
custom: 0,
};