-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawml.sql
48 lines (45 loc) · 1.73 KB
/
drawml.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CREATE TABLE `drawml`.`user` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`date_created` DATETIME DEFAULT NOW(),
`date_modified` DATETIME DEFAULT NOW(),
`user_id` VARCHAR(64) NOT NULL,
`pw` VARCHAR(64) NOT NULL,
PRIMARY KEY (`user_id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `user_id_name_UNIQUE` (`user_id` ASC));
CREATE TABLE `drawml`.`experiment` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`date_created` DATETIME DEFAULT NOW(),
`date_modified` DATETIME DEFAULT NOW(),
`name` VARCHAR(45) NOT NULL,
`user_id` INTEGER NOT NULL,
`xml` BLOB NULL,
`drawing` BLOB NULL,
PRIMARY KEY (`user_id`, `name`),
FOREIGN KEY user(user_id) REFERENCES user(id) ON DELETE CASCADE,
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `user_id_name_UNIQUE` (`user_id`, `name` ASC));
CREATE TABLE `drawml`.`data` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`date_created` DATETIME DEFAULT NOW(),
`date_modified` DATETIME DEFAULT NOW(),
`name` VARCHAR(255) NOT NULL,
`path` VARCHAR(255) NOT NULL,
`user_id` INTEGER NOT NULL,
`type` VARCHAR(16) NOT NULL,
PRIMARY KEY (`user_id`, `name`),
FOREIGN KEY user(user_id) REFERENCES user(id) ON DELETE CASCADE,
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `user_id_name_UNIQUE` (`user_id`, `name` ASC));
CREATE TABLE `drawml`.`trainedmodel` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`date_created` DATETIME DEFAULT NOW(),
`date_modified` DATETIME DEFAULT NOW(),
`name` VARCHAR(45) NOT NULL,
`path` VARCHAR(255) NOT NULL,
`xml` BLOB NOT NULL,
`user_id` INTEGER NOT NULL,
PRIMARY KEY (`user_id`, `name`),
FOREIGN KEY user(user_id) REFERENCES user(id) ON DELETE CASCADE,
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `user_id_name_UNIQUE` (`user_id`, `name` ASC));