
universe@20: -- This script creates the module management tables
universe@20: --
universe@2: 
universe@20: create table lpitcore_module (
universe@20:     modid       serial          primary key,
universe@20:     classname   varchar(100)    not null unique,
universe@20:     visible     boolean         not null default(true)
universe@20: );
universe@2: 
universe@20: create table lpitcore_user (
universe@20:     userid          serial          primary key,
universe@20:     username        varchar(50)     not null unique,
universe@20:     lastname        varchar(50),
universe@20:     givenname       varchar(50)
universe@20: );
universe@2: 
universe@20: create table lpitcore_authorization (
universe@20:     modid           integer         not null references lpitcore_modules(modid) on delete cascade,
universe@20:     userid          integer         not null references lpitcore_user(userid) on delete cascade,
universe@20:     power           integer         not null check(power >= 0)
universe@20: );
universe@5: 
universe@20: create table lpitcore_menu (
universe@20:     modid           integer         not null references lpitcore_modules(modid) on delete cascade,
universe@20:     userid          integer         not null references lpitcore_user(userid) on delete cascade,
universe@20:     seq             integer         not null
universe@20: );




