Line # Revision Author
1 296 ahitrov create table enquesta
2 (
3 id integer not null primary key default nextval('public.documents_id_seq'::text),
4 class text not null,
5 ctime timestamp not null default now(),
6 mtime timestamp not null default now(),
7 dtime timestamp not null default now(),
8 session_id char(32),
9 uid integer not null default 0,
10 object_class text not null default 'promosite::Voting',
11 object_id integer not null,
12 status smallint not null default 0,
13 sections integer[],
14 name text,
15 voting text,
16 data text
17 );
18 create index enquesta_sections on enquesta using gist ( "sections" "gist__int_ops" );
19 create index enquesta_object on enquesta (object_id);
20 create unique index enquesta_uid_vote on enquesta (uid, object_id) where uid > 0;
21 create unique index enquesta_session_vote on enquesta (session_id, object_id) where session_id IS NOT NULL;