# $Header: /raid/cvsroot/rt/etc/schema,v 1.3 1997/12/28 23:59:28 jesse Exp $
# $Tag$
#
# Request Tracker is Copyright 1997 Jesse Reed Vincent <jesse@fsck.com>
# RT is distribute under the terms of the GNU Public License


CREATE TABLE queue_acl (
  queue_id CHAR(40),
  user_id CHAR(40),
  display INT,
  manipulate INT,
  admin INT,
  mail INT
)\g

CREATE TABLE queue_areas (
  queue_id CHAR(40) NOT NULL,
  area CHAR(40) NOT NULL
)\g

CREATE TABLE users (
  user_id CHAR(40) NOT NULL PRIMARY KEY, 
  real_name CHAR(40),
  password CHAR(40), 			
  email CHAR(40),
  phone CHAR(15),
  office CHAR(30),
  comments CHAR(120),
  admin_rt INT
)\g
INSERT INTO users VALUES ('root', 'Reginald Oot', 'wordpass','root@localhost','432-HELP','Room 000','Keeper of the Blinkenlights',1)\g
CREATE TABLE queues (
 queue_id CHAR(40) NOT NULL PRIMARY KEY,
 mail_alias CHAR(40),
 comment_alias CHAR(40),
 m_owner_trans INT,             # notify owner on transaction
 m_members_trans INT,		# notify list members on transaction
 m_user_trans INT,		# notify requestor on transaction
 m_user_create INT,		# notify user on creation
 m_members_corresp INT,		# notify members on creation
 m_members_comment INT,		# notify members on comment
 m_user_resolve INT,		# mail user on resolution.  NOT YET IMPLEMENTED
 allow_user_create INT,		#let nonmembers create
 default_prio INT,
 default_final_prio INT,
 default_due_in INT		#reqs in this queue are due in X days by default
)\g

#
# Table structure for table 'each_req'
#

CREATE TABLE each_req (
  serial_num int(11) AUTO_INCREMENT PRIMARY KEY,
  effective_sn INT,
  queue_id CHAR(40),
  area CHAR(40),
  alias CHAR(40),
  keywords CHAR(200),
  requestors CHAR(200),
  owner CHAR(40),
  subject CHAR(200),
  initial_priority INT,
  final_priority INT,
  priority INT,
  status CHAR(10),
  time_worked INT,
  date_created INT,
  date_told INT,
  date_acted INT,
  date_due INT
) \g

#
# Table structure for table 'transactions'
#

CREATE TABLE transactions (
  id int(11) AUTO_INCREMENT PRIMARY KEY,
  effective_sn INT,
  serial_num INT,
  actor CHAR(40),
  type CHAR(20),
  trans_data CHAR(100),
  trans_date INT
) \g
