Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.DepartmentTag ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Description ===== Allows non department candidate date questions to be departmentalised. ===== Columns ===== ^ 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 | | | ===== Primary Key ===== * DepartmentTagID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Department | DepartmentID | [[database:tables:pears_department|pears.Department (departmentid)]] | ON DELETE CASCADE | | TagKey | TagLocation, TagID | [[database:tables:pears_tag|pears.tag (taglocation, tagid)]] | NOT NULL; ON DELETE CASCADE | ===== Referenced By ===== * No incoming foreign keys found. ===== Indexes ===== * No indexes found. ===== Triggers ===== * No triggers found. ===== Original SQL ===== <code sql> -- 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 </code> database/tables/pears_departmenttag.txt Last modified: 2026/08/07 19:24by 127.0.0.1