Table of Contents



pears.PersonIncompatibility

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

Description

Records incompatabilities between individual providors and recipients. Healthcare (esp Home Care) usage.

Columns

Column Type Null Default Comment
PersonIncompatibilityID char(20) NOT NULL
Person1ID char(20) NOT NULL
Person2ID char(20) NOT NULL
StaffID char(20) NULL
EntryDate date NULL
Description char(50) NULL

Primary Key

Foreign Keys

Constraint Columns References Delete/update action
staff StaffID pears.staff (staffid) ON DELETE SET NULL
Person1 Person1ID pears.Person (personid) NOT NULL; ON DELETE CASCADE
Person2 Person2ID pears.Person (personid) NOT NULL; ON DELETE CASCADE

Referenced By

Indexes

Triggers

Original SQL

-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."PersonIncompatibility"
-- Table comment: Records incompatabilities between individual providors and recipients. Healthcare (esp Home Care) usage.
-- Statement count: 5
 
CREATE TABLE "pears"."PersonIncompatibility" (
    "PersonIncompatibilityID"        CHAR(20) NOT NULL
   ,"Person1ID"                      CHAR(20) NOT NULL
   ,"Person2ID"                      CHAR(20) NOT NULL
   ,"StaffID"                        CHAR(20) NULL
   ,"EntryDate"                      DATE NULL
   ,"Description"                    CHAR(50) NULL
   ,PRIMARY KEY ("PersonIncompatibilityID" ASC) 
)
GO
 
 
COMMENT ON TABLE "pears"."PersonIncompatibility" IS 
	'Records incompatabilities between individual providors and recipients. Healthcare (esp Home Care) usage.'
GO
 
 
ALTER TABLE "pears"."PersonIncompatibility"
    ADD FOREIGN KEY "staff" ("StaffID" ASC)
    REFERENCES "pears"."staff" ("staffid")
    ON DELETE SET NULL
GO
 
 
ALTER TABLE "pears"."PersonIncompatibility"
    ADD NOT NULL FOREIGN KEY "Person1" ("Person1ID" ASC)
    REFERENCES "pears"."Person" ("personid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."PersonIncompatibility"
    ADD NOT NULL FOREIGN KEY "Person2" ("Person2ID" ASC)
    REFERENCES "pears"."Person" ("personid")
    ON DELETE CASCADE
GO