diff options
author | 2011-05-06 22:51:04 +0530 | |
---|---|---|
committer | 2011-05-06 22:51:04 +0530 | |
commit | bd2d27531a873bb1659b6a8d76737083c52c1967 (patch) | |
tree | 5b1fa39e767dee6c8a5af567fe2d3a7fce59f4e4 | |
parent | first commit for server code (diff) | |
download | gentoostats-bd2d27531a873bb1659b6a8d76737083c52c1967.tar.gz gentoostats-bd2d27531a873bb1659b6a8d76737083c52c1967.tar.bz2 gentoostats-bd2d27531a873bb1659b6a8d76737083c52c1967.zip |
sql tables created
-rw-r--r-- | server/sql/init.sql | 32 | ||||
-rw-r--r-- | server/sql/setup.sql | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/server/sql/init.sql b/server/sql/init.sql new file mode 100644 index 0000000..4fa490a --- /dev/null +++ b/server/sql/init.sql @@ -0,0 +1,32 @@ + +-- run as 'vh4x0r'@'localhost' identified by 'vh4x0r' +use gentoostats; + +drop table if exists hosts; +create table hosts ( + uuid varchar (40) primary key, + passwd varchar (40) not null +); + +drop table if exists env; +create table env ( + uuid varchar (40) references hosts.uuid, + var varchar (15) not null, + value varchar (100), + primary key (uuid, var) +); + +drop table if exists packages; +create table packages ( + cat varchar (20) not null, + pkg varchar (20) not null, + ver varchar (20) not null, + pkey serial primary key +); + +drop table if exists useflags; +create table useflags ( + uuid varchar (40) references host.uuid, + useflag varchar (20) not null, + pkey serial references packages.pkey +); diff --git a/server/sql/setup.sql b/server/sql/setup.sql new file mode 100644 index 0000000..98126d7 --- /dev/null +++ b/server/sql/setup.sql @@ -0,0 +1,3 @@ +-- run as root +create database gentoostats; +grant all on gentoostats.* to 'vh4x0r'@'localhost' identified by 'vh4x0r'; |