setup/postgres/psql_create_tables.sql

Sat, 09 May 2020 17:01:29 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 09 May 2020 17:01:29 +0200
changeset 34
824d4042c857
parent 31
58f78f0142e8
child 36
0f4f8f255c32
permissions
-rw-r--r--

cleanup and simplification of database access layer

-- This script creates the module management tables
--

create table lpitcore_module (
    modid       serial          primary key,
    classname   varchar(100)    not null unique,
    visible     boolean         not null default(true),
    priority    integer         not null default(1000)
);

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

create table lpitcore_authorization (
    modid           integer         not null references lpitcore_modules(modid) on delete cascade,
    userid          integer         not null references lpitcore_user(userid) on delete cascade,
    power           integer         not null check(power >= 0)
);

create table lpitcore_menu (
    modid           integer         not null references lpitcore_modules(modid) on delete cascade,
    userid          integer         not null references lpitcore_user(userid) on delete cascade,
    seq             integer         not null
);

mercurial