setup/postgres/psql_create_tables.sql

Fri, 22 May 2020 16:21:31 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 22 May 2020 16:21:31 +0200
changeset 71
dca186d3911f
parent 62
833e0385572a
child 75
33b6843fdf8a
permissions
-rw-r--r--

adds breadcrumb menu

-- This script creates the module management tables
--

create table lpit_user (
    userid          serial          primary key,
    username        varchar(50)     not null unique,
    mail            varchar(50),
    lastname        varchar(50),
    givenname       varchar(50)
);

create table lpit_project (
    id              serial          primary key,
    name            varchar(20)     not null unique,
    description     varchar(200),
    repoUrl         varchar(50),
    owner           integer         references lpit_user(userid)
);

create type version_status as enum (
    'Future',
    'Unreleased',
    'Released',
    'LTS',
    'Deprecated'
);

create table lpit_version (
    id              serial          primary key,
    project         integer         not null references lpit_project(id),
    name            varchar(20)     not null,
    ordinal         integer         not null default 0,
    status          version_status  not null default 'Future'
);

create type issue_status as enum (
    'InSpecification',
    'ToDo',
    'Scheduled',
    'InProgress',
    'InReview',
    'Done',
    'Rejected',
    'Withdrawn'
);

create type issue_category as enum (
    'Feature',
    'Improvement',
    'Bug',
    'Task',
    'Test'
);

create table lpit_issue (
    id              serial          primary key,
    project         integer         not null references lpit_project(id),
    status          issue_status    not null default 'InSpecification',
    category        issue_category  not null default 'Feature',
    subject         varchar(20)     not null,
    description     text,
    version_plan    integer         references lpit_version(id),
    version_done    integer         references lpit_version(id),
    created         timestamp       with time zone not null default now(),
    updated         timestamp       with time zone not null default now(),
    eta             date
);

mercurial