-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.sql
More file actions
40 lines (39 loc) · 1.41 KB
/
create.sql
File metadata and controls
40 lines (39 loc) · 1.41 KB
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
drop table if exists node;
drop table if exists poll;
drop table if exists data;
drop table if exists meta;
drop table if exists link;
create table node (
id BIGINT AUTO_INCREMENT,
type INTEGER NOT NULL DEFAULT 0,
date BIGINT NOT NULL DEFAULT 0,
primary key (id)
) ENGINE = InnoDB;
create table poll (
node BIGINT NOT NULL DEFAULT 0,
value DOUBLE PRECISION NOT NULL DEFAULT 0,
type SMALLINT NOT NULL DEFAULT 0,
date BIGINT NOT NULL DEFAULT 0,
primary key (node)
) ENGINE = InnoDB;
create table data (
id BIGINT AUTO_INCREMENT,
value BLOB,
type SMALLINT NOT NULL DEFAULT 0,
date BIGINT NOT NULL DEFAULT 0,
primary key (id)
) ENGINE = InnoDB;
create table meta (
node BIGINT NOT NULL DEFAULT 0,
data BIGINT NOT NULL DEFAULT 0,
type SMALLINT NOT NULL DEFAULT 0,
date BIGINT NOT NULL DEFAULT 0,
primary key (node,data)
) ENGINE = InnoDB;
create table link (
parent BIGINT NOT NULL DEFAULT 0,
child BIGINT NOT NULL DEFAULT 0,
type INTEGER NOT NULL DEFAULT 0,
date BIGINT NOT NULL DEFAULT 0,
primary key (parent,child)
) ENGINE = InnoDB;