CREATE TABLE PROJECT (
  PROJECT_ID KEY_FIELD NOT NULL,
  CODE LONG_CODE NOT NULL,
  DESCRIPTION LONGEST_DESCRIPTION NOT NULL,
  COMPANY_ID KEY_FIELD NOT NULL,
  PROJECT_MANAGER_ID KEY_FIELD_ALLOW_NULL,
  CONTRACTOR_ID KEY_FIELD_ALLOW_NULL,
  ARCHITECT_ID KEY_FIELD_ALLOW_NULL,
  FACILITY_OWNER_ID KEY_FIELD_ALLOW_NULL,
  ARCHITECTURAL_CONSULTANT_ID KEY_FIELD_ALLOW_NULL,
  JOBSITE_NAME LONG_NAME NOT NULL,
  JOBSITE_ADDRESS1 ADDRESS NOT NULL,
  JOBSITE_ADDRESS2 ADDRESS NOT NULL,
  JOBSITE_ADDRESS3 ADDRESS NOT NULL,
  JOBSITE_CITY CITY NOT NULL,
  JOBSITE_STATE STATE NOT NULL,
  JOBSITE_ZIP ZIP NOT NULL,
  JOBSITE_COUNTRY COUNTRY NOT NULL,
  JOBSITE_PHONE PHONE NOT NULL,
  JOBSITE_FAX PHONE NOT NULL,
  JOBSITE_CELL PHONE NOT NULL,
  JOBSITE_EMAIL EMAIL NOT NULL,
  JOBSITE_CONTACT "NAME" NOT NULL,
  JOBSITE_NOTES BLOB SUB_TYPE 2 SEGMENT SIZE 1,
  CREATED_DATE TIMESTAMP,
  SALES_PERSON_ID KEY_FIELD_ALLOW_NULL,
  START_DATE TIMESTAMP,
  COMPLETE_DATE TIMESTAMP,
  MEASUREMENT_SYSTEM SMALLINT NOT NULL,
  ELEVATION_PROJECT_ID KEY_FIELD_ALLOW_NULL,
  AUDIT_USER_ID KEY_FIELD_ALLOW_NULL,
  TRANSFER_SEQ_NUM INTEGER DEFAULT 0 NOT NULL,
  BID_REQUEST_SOURCE LONGEST_DESCRIPTION NOT NULL,
  PLAN_LOCATION LONGEST_DESCRIPTION NOT NULL,
  JOB_SITE_SUPER LONGEST_DESCRIPTION NOT NULL,
  JOB_SITE_FOREMAN LONGEST_DESCRIPTION NOT NULL,
  PROJECT_NOTES BLOB SUB_TYPE 1 SEGMENT SIZE 2048 CHARACTER SET ASCII,
  JOB_NUMBER LONG_CODE NOT NULL,
  FINISH_HDW_BY LONG_DESCRIPTION NOT NULL,
  PROJECT_ESTIMATOR_ID KEY_FIELD_ALLOW_NULL,
  SORT_ALPHA LONG_CODE NOT NULL,
  SORT_NUMERIC INTEGER NOT NULL,
  ESTIMATE_NUMBER LONG_CODE NOT NULL,
  SCHEDULE_NOTES BLOB_TEXT,
  KEYING_NOTES BLOB_TEXT,
  LABOR_RATE CURRENCY DEFAULT 0.00 NOT NULL,
  INSTALLATION_RATE CURRENCY DEFAULT 0.00 NOT NULL,
  PROJECT_TYPE_ID KEY_FIELD_ALLOW_NULL,
  SPEC_RATING_ID KEY_FIELD_ALLOW_NULL,
  DODGE_NUM LONG_CODE NOT NULL,
  GUIDE_SPEC "BOOLEAN" DEFAULT 'N' NOT NULL,
  ARCHITECTS_PROJECT_NUMBER LONG_CODE NOT NULL,
  HIDDEN "BOOLEAN" NOT NULL,
  NOTES_1 BLOB_TEXT,
  NOTES_2 BLOB_TEXT,
  NOTES_3 BLOB_TEXT,
  NOTES_4 BLOB_TEXT,
  NOTES_5 BLOB_TEXT);


ALTER TABLE PROJECT ADD CONSTRAINT PK_PROJECT PRIMARY KEY (PROJECT_ID);

