Source

cheesecake-service / database_schema.sql


-- Table: main_indices.
CREATE TABLE main_indices (
    id SERIAL,
    absolute INTEGER NOT NULL,
    relative INTEGER NOT NULL,

    PRIMARY KEY (id)
);

-- Table: releases.
CREATE TABLE releases (
    name TEXT,
    version TEXT,

    installability_id INTEGER REFERENCES main_indices NOT NULL,
    documentation_id INTEGER REFERENCES main_indices NOT NULL,
    code_kwalitee_id INTEGER REFERENCES main_indices NOT NULL,

    PRIMARY KEY (name, version)
);

-- Table: subindices.
CREATE TABLE subindices (
    main_index_id INTEGER REFERENCES main_indices,

    name TEXT,
    value INTEGER NOT NULL,
    details TEXT NOT NULL,

    PRIMARY KEY (main_index_id, name)
);

-- Table: releases_to_score.
CREATE TABLE releases_to_score (
    name TEXT,
    version TEXT,

    PRIMARY KEY (name, version)
);

-- Table: messages.
CREATE TABLE messages (
    id SERIAL,
    time TIMESTAMP,
    message TEXT,

    PRIMARY KEY (id)
);