BEGIN;

-- tables

CREATE TABLE systemservice (
 id serial,

 created timestamp with time zone not null default CURRENT_TIMESTAMP,
--HELP_EN_INFO:Creation Date
--HELP_EN_LONG:The date and time this record was created.
--HELP_NL_INFO:Datum aanmaak
--HELP_NL_LONG:De tijd en datum waarop dit is aangemaakt.

 lastupdate timestamp with time zone not null default CURRENT_TIMESTAMP,
--HELP_EN_INFO:Last Update
--HELP_EN_LONG:The date and time this record was updated.
--HELP_NL_INFO:Laatste wijziging
--HELP_NL_LONG:De tijd en datum van laatste wijziging.

 name varchar(255) NOT NULL default '',
--HELP_EN_INFO:service name
--HELP_EN_LONG:The name of this service.
--HELP_NL_INFO:service naam
--HELP_NL_LONG:De naam van deze sevice.

 shortname varchar(255) NOT NULL default '',
--HELP_EN_INFO:service system name
--HELP_EN_LONG:The name of this service in the system.
--HELP_NL_INFO:service naam
--HELP_NL_LONG:De naam van deze sevice in het systeem.

 description varchar(256) NOT NULL default '',
--HELP_EN_INFO:Description
--HELP_EN_LONG:The description for this service.
--HELP_NL_INFO:Omschrijving
--HELP_NL_LONG:Een omschrijving voor deze service.

 status varchar(8) NOT NULL default 'active'
   CHECK (status IN ('active', 'deleted')),
--HELP_EN_INFO:state
--HELP_EN_LONG:Service status.
--HELP_NL_INFO:status
--HELP_NL_LONG:De status van deze service.

 PRIMARY KEY  (id)
);

GRANT UPDATE, SELECT, INSERT, DELETE ON systemservice TO astium;
GRANT UPDATE, SELECT ON systemservice_id_seq TO astium;

INSERT into systemservice (name, shortname, status) values ('empty', 'empty', 'deleted');


INSERT INTO systemservice (name, shortname, description) VALUES ('Asterisk', 'asterisk', 'A complete PBX in software');
INSERT INTO systemservice (name, shortname, description) VALUES ('Astium Daemon', 'astiumd', 'The central processing daemon for the Astium PBX');
INSERT INTO systemservice (name, shortname, description) VALUES ('PostgreSQL', 'postgresql', 'An advanced database management system (DBMS)');
INSERT INTO systemservice (name, shortname, description) VALUES ('Apache', 'httpd', 'Apache HTTP Server');
INSERT INTO systemservice (name, shortname, description) VALUES ('Astcfgd', 'astcfgd', 'Astium Central configuration daemon');
INSERT INTO systemservice (name, shortname, description) VALUES ('Vsftpd', 'vsftpd', 'Very Secure FTP Daemon');
INSERT INTO systemservice (name, shortname, description) VALUES ('Postfix', 'postfix', 'Postfix mail server');
INSERT INTO systemservice (name, shortname, description) VALUES ('IAXmodem', 'iaxmodem', 'A software modem used for asterisk');
INSERT INTO systemservice (name, shortname, description) VALUES ('Hylafax', 'hylafax', 'A sophisticated enterprise strength fax package');

COMMIT;
