-------------------------------------------------------------------------------- -- Attendance -- a web application for taking attendance -- Copyright (C) 2006 Sam Clippinger (samc (at) silence (dot) org) -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- CREATE TABLE attendance_person_type ( person_type_id char(26) NOT NULL PRIMARY KEY, date_created datetime NOT NULL, date_modified datetime NOT NULL, name varchar(50) NOT NULL ); CREATE TABLE attendance_person ( person_id char(26) NOT NULL PRIMARY KEY, person_type_id char(26) NOT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, date_birth datetime NOT NULL, visible bit NOT NULL, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, comments text NOT NULL ); CREATE TABLE category ( category_id char(26) NOT NULL PRIMARY KEY, parent_category_id char(26) NOT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, compute_percentage bit NOT NULL, highlight_percentage int NOT NULL, name varchar(200) NOT NULL, prefix varchar(50) NOT NULL ); CREATE TABLE attendance_event ( event_id char(26) NOT NULL PRIMARY KEY, category_id char(26) NOT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, date_start datetime NOT NULL, name varchar(200) NOT NULL ); CREATE TABLE attendance_attribute ( attribute_id char(26) NOT NULL PRIMARY KEY, date_created datetime NOT NULL, date_modified datetime NOT NULL, name varchar(200) NOT NULL ); CREATE TABLE attendance_person_event ( person_event_id char(26) NOT NULL PRIMARY KEY, person_id char(26) NOT NULL, event_id char(26) NOT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, present bit NOT NULL, true_attribute_ids text NOT NULL, comments text NOT NULL ); CREATE TABLE user ( user_id char(26) NOT NULL PRIMARY KEY, theme_id char(26) NOT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, guest_account bit NOT NULL, type int NOT NULL, name varchar(100) NOT NULL, email_address varchar(200) NOT NULL, password varchar(25) NOT NULL );