- date_begin INTEGER default CURRENT_TIMESTAMP not null,
- date_end INTEGER not null,
- is_transparent INTEGER default 1 not null,
- is_public INTEGER default 1 not null,
- is_multiplechoice INTEGER default 1 not null,
- is_weighted INTEGER default 0 not null,
- is_open INTEGER default 0 not null,
- is_terminated INTEGER default 0 not null,
- id_author INTEGER, -- :COMMENT:maethor:120528: not null ?
- id_group INTEGER default 1 not null,
- FOREIGN KEY(id_author) REFERENCES users(id)
- FOREIGN KEY(id_group) REFERENCES groups(id)
+ date_begin INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ date_end INTEGER NOT NULL,
+ is_transparent BOOLEAN DEFAULT 1 NOT NULL,
+ is_public BOOLEAN DEFAULT 1 NOT NULL,
+ is_multiplechoice BOOLEAN DEFAULT 1 NOT NULL,
+ is_weighted BOOLEAN DEFAULT 0 NOT NULL,
+ is_open BOOLEAN DEFAULT 0 NOT NULL,
+ is_terminated BOOLEAN DEFAULT 0 NOT NULL,
+ id_author INTEGER DEFAULT 1 NOT NULL, -- :COMMENT:maethor:120528: not null ?
+ id_group INTEGER DEFAULT 1 NOT NULL,
+ FOREIGN KEY(id_author) REFERENCES users (id) ON DELETE SET DEFAULT,
+ FOREIGN KEY(id_group) REFERENCES groups (id),
+ CHECK (is_transparent IN (0, 1)),
+ CHECK (is_public IN (0, 1)),
+ CHECK (is_weighted IN (0, 1)),
+ CHECK (is_open IN (0, 1)),
+ CHECK (is_terminated IN (0, 1))