pears.DepartmentTag

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

Allows non department candidate date questions to be departmentalised.

Column Type Null Default Comment
DepartmentTagID char(20) NOT NULL
TagID char(3) NULL
TagLocation char(3) NULL 'P' Will always be P but needed for referential integrity
DepartmentID char(2) NULL
  • DepartmentTagID
Constraint Columns References Delete/update action
Department DepartmentID pears.Department (departmentid) ON DELETE CASCADE
TagKey TagLocation, TagID pears.tag (taglocation, tagid) NOT NULL; ON DELETE CASCADE
  • No incoming foreign keys found.
  • No indexes found.
  • No triggers found.
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."DepartmentTag"
-- Table comment: Allows non department candidate date questions to be departmentalised.
-- Statement count: 5
 
CREATE TABLE "pears"."DepartmentTag" (
    "DepartmentTagID"                CHAR(20) NOT NULL
   ,"TagID"                          CHAR(3) NULL
   ,"TagLocation"                    CHAR(3) NULL DEFAULT 'P'
   ,"DepartmentID"                   CHAR(2) NULL
   ,PRIMARY KEY ("DepartmentTagID" ASC) 
)
GO
 
 
COMMENT ON COLUMN "pears"."DepartmentTag"."TagLocation" IS 
	'Will always be P but needed for referential integrity'
GO
 
 
COMMENT ON TABLE "pears"."DepartmentTag" IS 
	'Allows non department candidate date questions to be departmentalised.'
GO
 
 
ALTER TABLE "pears"."DepartmentTag"
    ADD FOREIGN KEY "Department" ("DepartmentID" ASC)
    REFERENCES "pears"."Department" ("departmentid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."DepartmentTag"
    ADD NOT NULL FOREIGN KEY "TagKey" ("TagLocation" ASC,"TagID" ASC)
    REFERENCES "pears"."tag" ("taglocation","tagid")
    ON DELETE CASCADE
GO
  • database/tables/pears_departmenttag.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1