-- Configuration - Server
-- 
-- This application can connect to and remember multiple hosts which have a
-- seperate database for their files.   The primary table keeping track of
-- this is the SERVER table.
--
-- RELATIONS: NIL

CREATE TABLE Host (
    Host        TEXT    NOT NULL,
    Port        NUMBER  NOT NULL,
    Identifier  TEXT    NOT NULL,
    Pass        TEXT,
    Filename    TEXT    NOT NULL,
    CONSTRAINT pkConf_Host PRIMARY KEY (Host, Port)
);

-- Prevent non-unique identifiers
CREATE UNIQUE INDEX idxHost_Identifier ON Host (Identifier);


-- Language - Information
--
-- A more specific table that only contains information on that this specific
-- implementation carries.   Typically these entries are hidden to the user
-- and are instead used for maintenance purposes.
--
-- RELATIONS: NIL

CREATE TABLE Language (
    Code            TEXT    NOT NULL,
    Language        TEXT    NOT NULL,
    Filename        TEXT    NOT NULL,
    CONSTRAINT pkConf_Language PRIMARY KEY (Code)
);


-- Configuration - Setting
--
-- Settings are a very important part of any application.  The ability to
-- select defaults, specify locations and so forth are here.
--
-- The COMMENT field exists to append additional information to the tags
-- specified.
--
-- RELATIONS: NIL

CREATE TABLE Setting (
    Tag         TEXT    NOT NULL,
    Value       TEXT    NOT NULL,
    Comment     TEXT,
    CONSTRAINT pkConf_Setting PRIMARY KEY (Tag)
);