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.ContactDepartment ====== <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 ===== List of Departments offered for Client Contacts (NOT linked to IQX Department records) ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **ContactDepartmentID** | char(20) | NOT NULL | | | | Name | char(50) | NOT NULL | | | | DepartmentID | char(2) | NULL | | | | SortOrder | smallint | NULL | | | ===== Primary Key ===== * ContactDepartmentID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | department | DepartmentID | [[database:tables:pears_department|pears.Department (departmentid)]] | ON DELETE CASCADE | ===== Referenced By ===== * No incoming foreign keys found. ===== Indexes ===== ^ Name ^ Type ^ Columns ^ Detail ^ | ContactDepartment_sortorder | Index | DepartmentID, SortOrder, Name | | ===== Triggers ===== * No triggers found. ===== Original SQL ===== <code sql> -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."ContactDepartment" -- Table comment: List of Departments offered for Client Contacts (NOT linked to IQX Department records) -- Statement count: 4 CREATE TABLE "pears"."ContactDepartment" ( "ContactDepartmentID" char(20) NOT NULL ,"Name" char(50) NOT NULL ,"DepartmentID" char(2) NULL ,"SortOrder" smallint NULL ,PRIMARY KEY ("ContactDepartmentID" ASC) ) go COMMENT ON TABLE "pears"."ContactDepartment" IS 'List of Departments offered for Client Contacts (NOT linked to IQX Department records)' go ALTER TABLE "pears"."ContactDepartment" ADD FOREIGN KEY "department" ("DepartmentID" ASC) REFERENCES "pears"."Department" ("departmentid") ON DELETE CASCADE go CREATE INDEX "ContactDepartment_sortorder" ON "pears"."ContactDepartment" ( "DepartmentID","SortOrder","Name" ) go </code> database/tables/pears_contactdepartment.txt Last modified: 2026/08/07 19:24by 127.0.0.1