1 |
commit: bd2d27531a873bb1659b6a8d76737083c52c1967 |
2 |
Author: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri May 6 17:21:04 2011 +0000 |
4 |
Commit: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com> |
5 |
CommitDate: Fri May 6 17:21:04 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=bd2d2753 |
7 |
|
8 |
sql tables created |
9 |
|
10 |
--- |
11 |
server/sql/init.sql | 32 ++++++++++++++++++++++++++++++++ |
12 |
server/sql/setup.sql | 3 +++ |
13 |
2 files changed, 35 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/server/sql/init.sql b/server/sql/init.sql |
16 |
new file mode 100644 |
17 |
index 0000000..4fa490a |
18 |
--- /dev/null |
19 |
+++ b/server/sql/init.sql |
20 |
@@ -0,0 +1,32 @@ |
21 |
+ |
22 |
+-- run as 'vh4x0r'@'localhost' identified by 'vh4x0r' |
23 |
+use gentoostats; |
24 |
+ |
25 |
+drop table if exists hosts; |
26 |
+create table hosts ( |
27 |
+ uuid varchar (40) primary key, |
28 |
+ passwd varchar (40) not null |
29 |
+); |
30 |
+ |
31 |
+drop table if exists env; |
32 |
+create table env ( |
33 |
+ uuid varchar (40) references hosts.uuid, |
34 |
+ var varchar (15) not null, |
35 |
+ value varchar (100), |
36 |
+ primary key (uuid, var) |
37 |
+); |
38 |
+ |
39 |
+drop table if exists packages; |
40 |
+create table packages ( |
41 |
+ cat varchar (20) not null, |
42 |
+ pkg varchar (20) not null, |
43 |
+ ver varchar (20) not null, |
44 |
+ pkey serial primary key |
45 |
+); |
46 |
+ |
47 |
+drop table if exists useflags; |
48 |
+create table useflags ( |
49 |
+ uuid varchar (40) references host.uuid, |
50 |
+ useflag varchar (20) not null, |
51 |
+ pkey serial references packages.pkey |
52 |
+); |
53 |
|
54 |
diff --git a/server/sql/setup.sql b/server/sql/setup.sql |
55 |
new file mode 100644 |
56 |
index 0000000..98126d7 |
57 |
--- /dev/null |
58 |
+++ b/server/sql/setup.sql |
59 |
@@ -0,0 +1,3 @@ |
60 |
+-- run as root |
61 |
+create database gentoostats; |
62 |
+grant all on gentoostats.* to 'vh4x0r'@'localhost' identified by 'vh4x0r'; |