pears.TempShiftProgress

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

Progress of candidates put forward for TempShiftPlan.

Column Type Null Default Comment
TempShiftProgressID char(20) NOT NULL
TempShiftPlanID char(20) NOT NULL
Status char(1) NOT NULL
Note long varchar NULL
RejectionReason char(100) NULL
StaffID char(20) NOT NULL
PersonID char(20) NOT NULL
WhenEntered timestamp NULL current timestamp
  • TempShiftProgressID
Constraint Columns References Delete/update action
TempShiftPlan TempShiftPlanID pears.TempShiftPlan (TempShiftPlanID) NOT NULL; ON DELETE CASCADE
Staff StaffID pears.staff (staffid) NOT NULL;
Person PersonID pears.Person (personid) NOT NULL; ON DELETE CASCADE
Table Constraint Columns Referenced columns
pears.TempShiftProgressHistory TempShiftProgress TempShiftProgressID TempShiftProgressID
  • No indexes found.
Name Timing Event
TempShiftProgressInsert after insert order 1
TempShiftProgressUpdate after update of “status” order 1
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."TempShiftProgress"
-- Table comment: Progress of candidates put forward for TempShiftPlan.
-- Statement count: 9
 
CREATE TABLE "pears"."TempShiftProgress" (
    "TempShiftProgressID"            CHAR(20) NOT NULL
   ,"TempShiftPlanID"                CHAR(20) NOT NULL
   ,"Status"                         CHAR(1) NOT NULL
   ,"Note"                           long VARCHAR NULL
   ,"RejectionReason"                CHAR(100) NULL
   ,"StaffID"                        CHAR(20) NOT NULL
   ,"PersonID"                       CHAR(20) NOT NULL
   ,"WhenEntered"                    TIMESTAMP NULL DEFAULT CURRENT TIMESTAMP
   ,PRIMARY KEY ("TempShiftProgressID" ASC) 
)
GO
 
 
COMMENT ON TABLE "pears"."TempShiftProgress" IS 
	'Progress of candidates put forward for TempShiftPlan.'
GO
 
 
ALTER TABLE "pears"."TempShiftProgress"
    ADD NOT NULL FOREIGN KEY "TempShiftPlan" ("TempShiftPlanID" ASC)
    REFERENCES "pears"."TempShiftPlan" ("TempShiftPlanID")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."TempShiftProgress"
    ADD NOT NULL FOREIGN KEY "Staff" ("StaffID" ASC)
    REFERENCES "pears"."staff" ("staffid")
GO
 
 
ALTER TABLE "pears"."TempShiftProgress"
    ADD NOT NULL FOREIGN KEY "Person" ("PersonID" ASC)
    REFERENCES "pears"."Person" ("personid")
    ON DELETE CASCADE
GO
 
 
CREATE TRIGGER "TempShiftProgressInsert" after INSERT ORDER 1 ON
"pears"."TempShiftProgress"
REFERENCING NEW AS "new_prog"
FOR each ROW
BEGIN
  INSERT INTO "TempShiftProgressHistory"( "TempShiftProgressHistoryID","TempShiftProgressID","status","historydate","historytime","staffid","whenentered" ) VALUES
    ( "uniquekey"("new_prog"."TempShiftProgressID"),"new_prog"."TempShiftProgressID","new_prog"."status",CURRENT DATE,CURRENT TIME,"new_prog"."staffid","new_prog"."whenentered" ) 
END
GO
 
 
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."TempShiftProgress"."TempShiftProgressInsert" IS 
{CREATE TRIGGER TempShiftProgressInsert 
 after INSERT ORDER 1 ON
pears.TempShiftProgress
REFERENCING NEW AS new_prog
FOR each ROW
BEGIN
  INSERT INTO TempShiftProgressHistory( TempShiftProgressHistoryID,TempShiftProgressID,STATUS,historydate,historytime,staffid,whenentered) 
 VALUES( uniquekey(new_prog.TempShiftProgressID),new_prog.TempShiftProgressID,new_prog.status,CURRENT DATE,CURRENT TIME,new_prog.staffid,new_prog.whenentered) 
END
}
GO
 
 
CREATE TRIGGER "TempShiftProgressUpdate" after UPDATE OF "status"
ORDER 1 ON "pears"."TempShiftProgress"
REFERENCING NEW AS "new_prog"
FOR each ROW
BEGIN
  INSERT INTO "TempShiftProgressHistory"( "TempShiftProgressHistoryID","TempShiftProgressID","status","historydate","historytime","staffid","whenentered" ) VALUES
    ( "uniquekey"("new_prog"."TempShiftProgressID"),"new_prog"."TempShiftProgressID","new_prog"."status",CURRENT DATE,CURRENT TIME,"new_prog"."staffid","new_prog"."whenentered" ) 
END
GO
 
 
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."TempShiftProgress"."TempShiftProgressUpdate" IS 
{CREATE TRIGGER TempShiftProgressUpdate 
 after UPDATE OF STATUS
ORDER 1 ON pears.TempShiftProgress
REFERENCING NEW AS new_prog
FOR each ROW
BEGIN
  INSERT INTO TempShiftProgressHistory( TempShiftProgressHistoryID,TempShiftProgressID,STATUS,historydate,historytime,staffid,whenentered) 
 VALUES( uniquekey(new_prog.TempShiftProgressID),new_prog.TempShiftProgressID,new_prog.status,CURRENT DATE,CURRENT TIME,new_prog.staffid,new_prog.whenentered) 
END
}
GO
  • database/tables/pears_tempshiftprogress.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1