## SVN $Id$

ALTER TABLE `status` ADD `color` VARCHAR(10) NOT NULL;

CREATE TABLE `attachment` (
  `attachmentid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 
  `bugid` INT(10) UNSIGNED NOT NULL, 
  `filename` VARCHAR(255) NOT NULL, 
  `mimetype` VARCHAR(255) NOT NULL, 
  `filesize` INT(20) UNSIGNED NOT NULL, 
  `attachment` MEDIUMTEXT NOT NULL, 
  `description` VARCHAR(255) NOT NULL, 
  `dateline` INT(20) UNSIGNED NOT NULL, 
  `userid` INT(10) UNSIGNED NOT NULL, 
  `obsolete` INT(1) UNSIGNED NOT NULL,
  PRIMARY KEY (`attachmentid`)
);

CREATE TABLE `history` (
  `historyid` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, 
  `bugid` INT(10) UNSIGNED NOT NULL, 
  `dateline` INT(20) UNSIGNED NOT NULL, 
  `userid` INT(10) UNSIGNED NOT NULL, 
  `language` VARCHAR(255) NOT NULL, 
  `arguments` MEDIUMTEXT NOT NULL, 
  `field` VARCHAR(255) NOT NULL, 
  `original` MEDIUMTEXT NOT NULL, 
  `changed` MEDIUMTEXT NOT NULL, 
  PRIMARY KEY (`historyid`)
);

CREATE TABLE `bugfield` (
  `fieldid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 
  `shortname` VARCHAR(100) NOT NULL, 
  `name` VARCHAR(255) NOT NULL, 
  `description` MEDIUMTEXT NOT NULL, 
  `type` VARCHAR(50) NOT NULL, 
  `selects` MEDIUMTEXT NOT NULL, 
  `required` INT(2) NOT NULL, 
  `private` INT(2) NOT NULL, 
  `regexmatch` MEDIUMTEXT NOT NULL, 
  `defaultvalue` MEDIUMTEXT NOT NULL, 
  `usedefault` INT(2) NOT NULL, 
  `maxlength` INT(5) UNSIGNED NOT NULL,
  PRIMARY KEY (`fieldid`)
);

CREATE TABLE `bugvaluefill` (
  `bugid` INT(10) UNSIGNED NOT NULL,
  PRIMARY KEY (`bugid`)
);

ALTER TABLE `bug` ADD `hidden` INT(2) UNSIGNED NOT NULL AFTER `assignedto`;

ALTER TABLE `comment` ADD `hidden` INT(2) UNSIGNED NOT NULL;

ALTER TABLE `bug` ADD `hiddenlastposttime` INT(10) UNSIGNED NOT NULL, ADD `hiddenlastpostby` INT(10) UNSIGNED NOT NULL;