-- Copyright (C) 2003 Media Net Link, Inc. Danville, CA 94526 USA
-- 
-- This file is part of AthenaRMS.
-- 
-- AthenaRMS 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.
-- 
-- AthenaRMS 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 company_crm (
  company_id varchar(50) not null,
  crm_id int primary key,
  crm_name varchar(255),
  crm_short_name varchar(32) not null,
  default_problem_id int,
  default_source_id int,
  email_source_id int,
  default_support_person_id int not null,
  default_escalated_to_id int not null,
  updated_date timestamp,
  updated_by varchar(255),
  created_date timestamp,
  created_by varchar(255),
  email_domain varchar(255) not null,
  web_domain varchar(250) not null,
  web_path varchar(250) not null,
  users_url varchar(255) not null,
  email_sig text not null,
  backup_email varchar(255),
  extended_email_sig text,
  new_ticket_notify char(1) default 'N' not null,
  web_page_id int not null,
  confirmation_url text,
  unique (web_domain, web_path),
  unique (crm_short_name),
  foreign key (company_id) references company (company_id),
  foreign key (new_ticket_notify) references yes_no (yes_no)
);
