====== pears.ConsentType ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Master records for different types of Consent (GDPR)
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **ConsentTypeID** | char(20) | NOT NULL | | |
| Name | char(100) | NOT NULL | | |
| DivisionID | char(20) | NULL | | |
| Notes | long varchar | NULL | | |
===== Primary Key =====
* ConsentTypeID
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| division | DivisionID | [[database:tables:pears_division|pears.Division (divisionid)]] | ON DELETE SET NULL |
===== Referenced By =====
^ Table ^ Constraint ^ Columns ^ Referenced columns ^
| [[database:tables:pears_consentpersonoption|pears.ConsentPersonOption]] | ConsentType | ConsentTypeID | ConsentTypeID |
| [[database:tables:pears_consentpersonoptionhistory|pears.ConsentPersonOptionHistory]] | ConsentType | ConsentTypeID | ConsentTypeID |
| [[database:tables:pears_consenttypeoption|pears.ConsentTypeOption]] | ConsentType | ConsentTypeID | ConsentTypeID |
===== Indexes =====
* No indexes found.
===== Triggers =====
* No triggers found.
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."ConsentType"
-- Table comment: Master records for different types of Consent (GDPR)
-- Statement count: 3
CREATE TABLE "pears"."ConsentType" (
"ConsentTypeID" char(20) NOT NULL
,"Name" char(100) NOT NULL
,"DivisionID" char(20) NULL
,"Notes" long varchar NULL
,PRIMARY KEY ("ConsentTypeID" ASC)
)
go
COMMENT ON TABLE "pears"."ConsentType" IS
'Master records for different types of Consent (GDPR)'
go
ALTER TABLE "pears"."ConsentType"
ADD FOREIGN KEY "division" ("DivisionID" ASC)
REFERENCES "pears"."Division" ("divisionid")
ON DELETE SET NULL
go