-- Users table schema
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `principle_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `type` enum('principle','contact','user') NOT NULL,
  `access_level` enum('admin','manager','user','none') NOT NULL DEFAULT 'none',
  `username` char(50) NOT NULL,
  `password` char(60) NOT NULL,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `job_title` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `mobile` varchar(255) NOT NULL,
  `fax` varchar(255) NOT NULL,
  `phone_extension` varchar(255) NOT NULL,
  `direct_phone` varchar(255) NOT NULL,
  `notes` text NOT NULL,
  `by_vault` tinyint(1) NOT NULL COMMENT 'Added by Vault. May or may not be a real person.',
  `blacklisted` tinyint(1) NOT NULL COMMENT 'Disregard emails from this address in future.',
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `archived` tinyint(1) DEFAULT 0,
  `primary_contact` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=48276 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;