====== pears.ConsentPersonOptionHistory ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== History of changes to person consent (GDPR etc) settings ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **ConsentPersonOptionHistoryID** | char(20) | NOT NULL | | | | ConsentTypeID | char(20) | NULL | | | | ConsentTypeOptionID | char(20) | NULL | | | | PersonID | char(20) | NULL | | | | WhoEntered | char(20) | NULL | | | | WithdrawDate | date | NULL | | | | EventDateTime | timestamp | NULL | current timestamp | | | ConnectionNumber | integer | NULL | | | ===== Primary Key ===== * ConsentPersonOptionHistoryID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | ConsentType | ConsentTypeID | [[database:tables:pears_consenttype|pears.ConsentType (ConsentTypeID)]] | | | ConsentTypeOption | ConsentTypeOptionID | [[database:tables:pears_consenttypeoption|pears.ConsentTypeOption (ConsentTypeOptionID)]] | | | Person | PersonID | [[database:tables:pears_person|pears.Person (personid)]] | ON DELETE CASCADE | ===== Referenced By ===== * No incoming foreign keys found. ===== Indexes ===== * No indexes found. ===== Triggers ===== * No triggers found. ===== Original SQL ===== -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."ConsentPersonOptionHistory" -- Table comment: History of changes to person consent (GDPR etc) settings -- Statement count: 5 CREATE TABLE "pears"."ConsentPersonOptionHistory" ( "ConsentPersonOptionHistoryID" char(20) NOT NULL ,"ConsentTypeID" char(20) NULL ,"ConsentTypeOptionID" char(20) NULL ,"PersonID" char(20) NULL ,"WhoEntered" char(20) NULL ,"WithdrawDate" date NULL ,"EventDateTime" timestamp NULL DEFAULT current timestamp ,"ConnectionNumber" integer NULL ,PRIMARY KEY ("ConsentPersonOptionHistoryID" ASC) ) go COMMENT ON TABLE "pears"."ConsentPersonOptionHistory" IS 'History of changes to person consent (GDPR etc) settings ' go ALTER TABLE "pears"."ConsentPersonOptionHistory" ADD FOREIGN KEY "ConsentType" ("ConsentTypeID" ASC) REFERENCES "pears"."ConsentType" ("ConsentTypeID") go ALTER TABLE "pears"."ConsentPersonOptionHistory" ADD FOREIGN KEY "ConsentTypeOption" ("ConsentTypeOptionID" ASC) REFERENCES "pears"."ConsentTypeOption" ("ConsentTypeOptionID") go ALTER TABLE "pears"."ConsentPersonOptionHistory" ADD FOREIGN KEY "Person" ("PersonID" ASC) REFERENCES "pears"."Person" ("personid") ON DELETE CASCADE go