====== pears.ComplianceDomainTag ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Tags used in Compliance Domains
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **ComplianceDomainID** | char(20) | NOT NULL | | |
| **TagLocation** | char(2) | NOT NULL | | P for Person questionnaire, A% for Departmental |
| **TagID** | char(3) | NOT NULL | | |
| **TagChoiceID** | char(4) | NOT NULL | 'N/A' | N/A signifies any or not applicable. Cannot be null because of pk. |
| Behaviour | tinyint | NOT NULL | 1 | 1=required 2=warning 3=score only |
| Score | smallint | NOT NULL | 1 | |
| MinValue | double | NOT NULL | 1 | For numerics, scored and graded choices |
| SortOrder | smallint | NULL | | |
===== Primary Key =====
* ComplianceDomainID, TagLocation, TagID, TagChoiceID
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| ComplianceDomain | ComplianceDomainID | [[database:tables:pears_compliancedomain|pears.ComplianceDomain (ComplianceDomainID)]] | NOT NULL; 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"."ComplianceDomainTag"
-- Table comment: Tags used in Compliance Domains
-- Statement count: 7
CREATE TABLE "pears"."ComplianceDomainTag" (
"ComplianceDomainID" char(20) NOT NULL
,"TagLocation" char(2) NOT NULL
,"TagID" char(3) NOT NULL
,"TagChoiceID" char(4) NOT NULL DEFAULT 'N/A'
,"Behaviour" tinyint NOT NULL DEFAULT 1
,"Score" smallint NOT NULL DEFAULT 1
,"MinValue" double NOT NULL DEFAULT 1
,"SortOrder" smallint NULL
,PRIMARY KEY ("ComplianceDomainID" ASC,"TagLocation" ASC,"TagID" ASC,"TagChoiceID" ASC)
)
go
COMMENT ON COLUMN "pears"."ComplianceDomainTag"."TagLocation" IS
'P for Person questionnaire, A% for Departmental'
go
COMMENT ON COLUMN "pears"."ComplianceDomainTag"."TagChoiceID" IS
'N/A signifies any or not applicable. Cannot be null because of pk.'
go
COMMENT ON COLUMN "pears"."ComplianceDomainTag"."Behaviour" IS
'1=required 2=warning 3=score only'
go
COMMENT ON COLUMN "pears"."ComplianceDomainTag"."MinValue" IS
'For numerics, scored and graded choices'
go
COMMENT ON TABLE "pears"."ComplianceDomainTag" IS
'Tags used in Compliance Domains'
go
ALTER TABLE "pears"."ComplianceDomainTag"
ADD NOT NULL FOREIGN KEY "ComplianceDomain" ("ComplianceDomainID" ASC)
REFERENCES "pears"."ComplianceDomain" ("ComplianceDomainID")
ON DELETE CASCADE
go