-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdb.config
60 lines (40 loc) · 1.8 KB
/
db.config
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
49
50
51
52
53
54
55
56
57
58
59
60
# init to rev1
create database rev1;
create table solars (
sid serial primary key,
name varchar(255)
);
create table planets (
pid serial primary key,
sid int(10),
name varchar(255),
value text
);
insert into solars (name) value ('intuit');
insert into planets (sid, name, value) values (1, 'ticker', 'INTU'), (1, 'price', '59');
# change to rev2
create database rev2;
use rev2;
create table nodes ( id serial primary key, name varchar(255), jitid varchar(255), value text );
create table childs ( id serial primary key, pid bigint(20) unsigned, chid bigint(20) unsigned );
insert into nodes (name, jitid) values ('intuit', 'Az9'), ('fin info', '239');
insert into nodes (name, jitid, value) values ('ticker', '8ob', 'INTU'), ('price', '7br', '59');
insert into childs (pid, chid) values ('1', '2'), ('2', '3'), ('2', '4');
# new user and change to rev3
create user 'pybros'@'localhost' identified by 'getIn2it';
create database rev3;
grant all on rev3.* to 'pybros'@'localhost';
use rev3;
create table nodes ( nid serial primary key, name varchar(255), jitid varchar(64), value text );
create table relations ( rid serial primary key, pid bigint(20) unsigned, chid bigint(20) unsigned );
# change to rev4
create database rev4;
grant all on rev4.* to 'pybros'@'localhost';
use rev4;
create table nodes ( nid serial primary key );
create table edges ( eid serial primary key, parent_id bigint(20) unsigned, child_id bigint(20) unsigned );
create table node_attrs ( naid serial primary key, node_id bigint(20) unsigned, name varchar(255), value text );
create table edge_attrs ( eaid serial primary key, edge_id bigint(20) unsigned, name varchar(255), value text );
# create 3 nodes
insert into nodes () values (), (), ();
insert into edges (parent_id, child_id) values (1, 2), (1, 3), (2, 4), (3, 5), (3, 6);