setup/postgres/psql_create_tables.sql

changeset 36
0f4f8f255c32
parent 31
58f78f0142e8
child 37
fecda0f466e6
equal deleted inserted replaced
35:4fa33bfa8fb9 36:0f4f8f255c32
1 -- This script creates the module management tables 1 -- This script creates the module management tables
2 -- 2 --
3
4 create table lpitcore_module (
5 modid serial primary key,
6 classname varchar(100) not null unique,
7 visible boolean not null default(true),
8 priority integer not null default(1000)
9 );
10 3
11 create table lpitcore_user ( 4 create table lpitcore_user (
12 userid serial primary key, 5 userid serial primary key,
13 username varchar(50) not null unique, 6 username varchar(50) not null unique,
14 lastname varchar(50), 7 lastname varchar(50),
15 givenname varchar(50) 8 givenname varchar(50)
16 ); 9 );
17
18 create table lpitcore_authorization (
19 modid integer not null references lpitcore_modules(modid) on delete cascade,
20 userid integer not null references lpitcore_user(userid) on delete cascade,
21 power integer not null check(power >= 0)
22 );
23
24 create table lpitcore_menu (
25 modid integer not null references lpitcore_modules(modid) on delete cascade,
26 userid integer not null references lpitcore_user(userid) on delete cascade,
27 seq integer not null
28 );

mercurial