added schema

This commit is contained in:
xdrm-brackets 2017-09-18 16:48:43 +02:00
parent 0f119690d9
commit 9dbbc1e3dc
1 changed files with 106 additions and 104 deletions

View File

@ -1,125 +1,127 @@
{ {
"default": {
"warehouse": {
"id_warehouse": { "type": "int", "primary": true, "auto_increment": true },
"name": { "type": "varchar(30)" },
"theme": { "type": "varchar(6)" },
"password": { "type": "varchar(128)" },
"token": { "type": "varchar(128)" }
},
"warehouse": { "admin": {
"id_warehouse": { "type": "int", "primary": true, "auto_increment": true }, "id_admin": { "type": "int", "primary": true, "auto_increment": true },
"name": { "type": "varchar(30)" }, "@id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"theme": { "type": "varchar(6)" }, "username": { "type": "varchar(30)" },
"password": { "type": "varchar(128)" }, "mail": { "type": "varchar(50)" },
"token": { "type": "varchar(128)" } "password": { "type": "varchar(128)" },
}, "token": { "type": "varchar(128)" }
},
"admin": { "user": {
"id_admin": { "type": "int", "primary": true, "auto_increment": true }, "id_user": { "type": "int", "primary": true, "auto_increment": true },
"@id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"username": { "type": "varchar(30)" }, "code": { "type": "varchar(20)" },
"mail": { "type": "varchar(50)" }, "username": { "type": "varchar(30)" },
"password": { "type": "varchar(128)" }, "firstname": { "type": "varchar(30)" },
"token": { "type": "varchar(128)" } "lastname": { "type": "varchar(30)" },
}, "mail": { "type": "varchar(50)" }
},
"user": { "machine": {
"id_user": { "type": "int", "primary": true, "auto_increment": true }, "id_machine": { "type": "int", "primary": true, "auto_increment": true },
"#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"code": { "type": "varchar(20)" }, "name": { "type": "varchar(30)" },
"username": { "type": "varchar(30)" }, "token": { "type": "varchar(128)" },
"firstname": { "type": "varchar(30)" }, "unlock_code": { "type": "varchar(128)" },
"lastname": { "type": "varchar(30)" }, "ap": { "type": "varchar(30)" },
"mail": { "type": "varchar(50)" } "ip": { "type": "varchar(16)" }
}, },
"machine": { "user_cluster": {
"id_machine": { "type": "int", "primary": true, "auto_increment": true }, "id_user_cluster": { "type": "int", "primary": true, "auto_increment": true },
"#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"name": { "type": "varchar(30)" }, "name": { "type": "varchar(30)" }
"token": { "type": "varchar(128)" }, },
"unlock_code": { "type": "varchar(128)" },
"ap": { "type": "varchar(30)" },
"ip": { "type": "varchar(16)" }
},
"user_cluster": { "machine_cluster": {
"id_user_cluster": { "type": "int", "primary": true, "auto_increment": true }, "id_machine_cluster": { "type": "int", "primary": true, "auto_increment": true },
"#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"name": { "type": "varchar(30)" } "name": { "type": "varchar(30)" }
}, },
"machine_cluster": { "user_cluster_merge": {
"id_machine_cluster": { "type": "int", "primary": true, "auto_increment": true }, "id_user_cluster_merge": { "type": "int", "primary": true, "auto_increment": true },
"#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "#id_user_cluster": { "type": "int", "ref": [ "user_cluster", "id_user_cluster" ] },
"name": { "type": "varchar(30)" } "#id_user": { "type": "int", "ref": [ "user", "id_user" ] }
}, },
"user_cluster_merge": { "machine_cluster_merge": {
"id_user_cluster_merge": { "type": "int", "primary": true, "auto_increment": true }, "id_machine_cluster_merge": { "type": "int", "primary": true, "auto_increment": true },
"#id_user_cluster": { "type": "int", "ref": [ "user_cluster", "id_user_cluster" ] }, "#id_machine_cluster": { "type": "int", "ref": [ "machine_cluster", "id_machine_cluster" ] },
"#id_user": { "type": "int", "ref": [ "user", "id_user" ] } "#id_machine": { "type": "int", "ref": [ "machine", "id_machine" ] }
}, },
"machine_cluster_merge": { "module": {
"id_machine_cluster_merge": { "type": "int", "primary": true, "auto_increment": true }, "id_module": { "type": "int", "primary": true, "auto_increment": true },
"#id_machine_cluster": { "type": "int", "ref": [ "machine_cluster", "id_machine_cluster" ] }, "name": { "type": "varchar(50)" }
"#id_machine": { "type": "int", "ref": [ "machine", "id_machine" ] } },
},
"module": { "module_merge": {
"id_module": { "type": "int", "primary": true, "auto_increment": true }, "#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] },
"name": { "type": "varchar(50)" } "#id_module": { "type": "int", "ref": [ "module", "id_module" ] }
}, },
"module_merge": { "chip": {
"#id_warehouse": { "type": "int", "ref": [ "warehouse", "id_warehouse" ] }, "id_chip": { "type": "int", "primary": true, "auto_increment": true },
"#id_module": { "type": "int", "ref": [ "module", "id_module" ] } "#id_module": { "type": "int", "ref": [ "module", "id_module" ] },
}, "name": { "type": "varchar(20)" },
"position": { "type": "int" },
"type": { "type": "varchar(10)" }
},
"chip": { "global_state": {
"id_chip": { "type": "int", "primary": true, "auto_increment": true }, "id_global_state": { "type": "int", "primary": true, "auto_increment": true },
"#id_module": { "type": "int", "ref": [ "module", "id_module" ] }, "global_state": { "type": "varchar(20)" },
"name": { "type": "varchar(20)" }, "chips": { "type": "varchar(30)" }
"position": { "type": "int" }, },
"type": { "type": "varchar(10)" }
},
"global_state": { "pin_merge": {
"id_global_state": { "type": "int", "primary": true, "auto_increment": true }, "id_pin_merge": { "type": "int", "primary": true, "auto_increment": true },
"global_state": { "type": "varchar(20)" }, "#id_chip": { "type": "int", "ref": [ "chip", "id_chip" ] },
"chips": { "type": "varchar(30)" } "pin": { "type": "int" },
}, "type": { "type": "varchar(30)" }
},
"pin_merge": { "state": {
"id_pin_merge": { "type": "int", "primary": true, "auto_increment": true }, "id_state": { "type": "int", "primary": true, "auto_increment": true },
"#id_chip": { "type": "int", "ref": [ "chip", "id_chip" ] }, "#id_pin_merge": { "type": "int", "ref": [ "pin_merge", "id_pin_merge" ] },
"pin": { "type": "int" }, "state": { "type": "varchar(1)" },
"type": { "type": "varchar(30)" } "value": { "type": "int" }
}, },
"state": { "action": {
"id_state": { "type": "int", "primary": true, "auto_increment": true }, "id_action": { "type": "int", "primary": true, "auto_increment": true },
"#id_pin_merge": { "type": "int", "ref": [ "pin_merge", "id_pin_merge" ] }, "name": { "type": "varchar(30)" },
"state": { "type": "varchar(1)" }, "timeout": { "type": "int" },
"value": { "type": "int" } "previous": { "type": "varchar(20)" },
}, "action": { "type": "varchar(20)" }
},
"action": { "action_merge": {
"id_action": { "type": "int", "primary": true, "auto_increment": true }, "id_action_merge": { "type": "int", "primary": true, "auto_increment": true },
"name": { "type": "varchar(30)" }, "#id_target": { "type": "int", "ref": [ "machine_cluster", "id_machine_cluster" ] },
"timeout": { "type": "int" }, "#id_source": { "type": "int", "ref": [ "user_cluster", "id_user_cluster" ] },
"previous": { "type": "varchar(20)" }, "#id_action": { "type": "int", "ref": [ "action", "id_action" ] }
"action": { "type": "varchar(20)" } },
},
"action_merge": { "history": {
"id_action_merge": { "type": "int", "primary": true, "auto_increment": true }, "id_history": { "type": "int", "primary": true, "auto_increment": true },
"#id_target": { "type": "int", "ref": [ "machine_cluster", "id_machine_cluster" ] }, "timestamp": { "type": "int" },
"#id_source": { "type": "int", "ref": [ "user_cluster", "id_user_cluster" ] }, "#id_user": { "type": "int", "ref": [ "user", "id_user" ] },
"#id_action": { "type": "int", "ref": [ "action", "id_action" ] } "#id_machine": { "type": "int", "ref": [ "machine", "id_machine" ] },
}, "#id_action": { "type": "int", "ref": [ "action", "id_action" ] }
}
"history": {
"id_history": { "type": "int", "primary": true, "auto_increment": true },
"timestamp": { "type": "int" },
"#id_user": { "type": "int", "ref": [ "user", "id_user" ] },
"#id_machine": { "type": "int", "ref": [ "machine", "id_machine" ] },
"#id_action": { "type": "int", "ref": [ "action", "id_action" ] }
} }
} }