====== pears.PlacementDayVariation ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== For Contract work hour variations ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **PlacementID** | char(20) | NOT NULL | | | | **VariationDate** | date | NOT NULL | | | | WorkStartTime | time | NULL | | | | WorkHours | double | NULL | | | | WorkCancelled | tinyint | NULL | | | | TempShiftCancelReasonID | char(1) | NULL | | | ===== Primary Key ===== * PlacementID, VariationDate ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | placement | PlacementID | [[database:tables:pears_placement|pears.Placement (placementid)]] | NOT NULL; ON DELETE CASCADE | | TempShiftCancelReason | TempShiftCancelReasonID | [[database:tables:pears_tempshiftcancelreason|pears.TempShiftCancelReason (TempShiftCancelReasonID)]] | ON DELETE SET NULL | ===== Referenced By ===== * No incoming foreign keys found. ===== Indexes ===== * No indexes found. ===== Triggers ===== * No triggers found. ===== Original SQL ===== -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."PlacementDayVariation" -- Table comment: For Contract work hour variations -- Statement count: 4 CREATE TABLE "pears"."PlacementDayVariation" ( "PlacementID" char(20) NOT NULL ,"VariationDate" date NOT NULL ,"WorkStartTime" time NULL ,"WorkHours" double NULL ,"WorkCancelled" tinyint NULL ,"TempShiftCancelReasonID" char(1) NULL ,PRIMARY KEY ("PlacementID" ASC,"VariationDate" ASC) ) go COMMENT ON TABLE "pears"."PlacementDayVariation" IS 'For Contract work hour variations' go ALTER TABLE "pears"."PlacementDayVariation" ADD NOT NULL FOREIGN KEY "placement" ("PlacementID" ASC) REFERENCES "pears"."Placement" ("placementid") ON DELETE CASCADE go ALTER TABLE "pears"."PlacementDayVariation" ADD FOREIGN KEY "TempShiftCancelReason" ("TempShiftCancelReasonID" ASC) REFERENCES "pears"."TempShiftCancelReason" ("TempShiftCancelReasonID") ON DELETE SET NULL go