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.IQXNetCandidateShifts ====== <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 ===== Populated by the "PopulateCandidateShifts" process — stores which "TempShiftPlan" shifts are available and eligible for each candidate to book. Acts as a security gate: a candidate cannot book a shift unless a matching row exists in this table. The populate process applies filtering rules (availability, grade, requirements etc.) defined in "IQXNetBehaviour" before inserting rows. ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **PersonID** | char(20) | NOT NULL | | FK → Person — the eligible candidate | | **TempShiftPlanID** | char(20) | NOT NULL | | FK → TempShiftPlan — the shift on offer | | Matched | char(1) | NULL | | | ===== Primary Key ===== * PersonID, TempShiftPlanID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Person | PersonID | [[database:tables:pears_person|pears.Person (personid)]] | NOT NULL; ON DELETE CASCADE | | TempShiftPlan | TempShiftPlanID | [[database:tables:pears_tempshiftplan|pears.TempShiftPlan (TempShiftPlanID)]] | 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"."IQXNetCandidateShifts" -- Table comment: Populated by the "PopulateCandidateShifts" process — stores which "TempShiftPlan" shifts are available and eligible for each candidate to book. Acts as a security gate: a candidate cannot book a shift unless a matching row exists in this table. The populate process applies filtering rules (availability, grade, requirements etc.) defined in "IQXNetBehaviour" before inserting rows. -- Statement count: 6 CREATE TABLE "pears"."IQXNetCandidateShifts" ( "PersonID" char(20) NOT NULL ,"TempShiftPlanID" char(20) NOT NULL ,"Matched" char(1) NULL ,PRIMARY KEY ("PersonID" ASC,"TempShiftPlanID" ASC) ) go COMMENT ON COLUMN "pears"."IQXNetCandidateShifts"."PersonID" IS 'FK → Person — the eligible candidate' go COMMENT ON COLUMN "pears"."IQXNetCandidateShifts"."TempShiftPlanID" IS 'FK → TempShiftPlan — the shift on offer' go COMMENT ON TABLE "pears"."IQXNetCandidateShifts" IS 'Populated by the "PopulateCandidateShifts" process — stores which "TempShiftPlan" shifts are available and eligible for each candidate to book. Acts as a security gate: a candidate cannot book a shift unless a matching row exists in this table. The populate process applies filtering rules (availability, grade, requirements etc.) defined in "IQXNetBehaviour" before inserting rows.' go ALTER TABLE "pears"."IQXNetCandidateShifts" ADD NOT NULL FOREIGN KEY "Person" ("PersonID" ASC) REFERENCES "pears"."Person" ("personid") ON DELETE CASCADE go ALTER TABLE "pears"."IQXNetCandidateShifts" ADD NOT NULL FOREIGN KEY "TempShiftPlan" ("TempShiftPlanID" ASC) REFERENCES "pears"."TempShiftPlan" ("TempShiftPlanID") ON DELETE CASCADE go </code> database/tables/pears_iqxnetcandidateshifts.txt Last modified: 2026/08/07 19:24by 127.0.0.1