====== pears.AutoMatchPersonPreferredShiftType ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== Preferred shift template group ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **AutoMatchPersonPreferredShiftTypeID** | char(20) | NOT NULL | | | | PersonID | char(20) | NULL | | | | ShiftTemplateGroupID | char(20) | NULL | | | | Created | timestamp | NULL | current timestamp | | | Weighting | tinyint | NULL | | | ===== Primary Key ===== * AutoMatchPersonPreferredShiftTypeID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Person | PersonID | [[database:tables:pears_person|pears.Person (personid)]] | ON DELETE CASCADE | | ShiftTemplateGroup | ShiftTemplateGroupID | [[database:tables:pears_shifttemplategroup|pears.ShiftTemplateGroup (ShiftTemplateGroupID)]] | ON DELETE CASCADE | ===== 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"."AutoMatchPersonPreferredShiftType" -- Table comment: Preferred shift template group -- Statement count: 4 CREATE TABLE "pears"."AutoMatchPersonPreferredShiftType" ( "AutoMatchPersonPreferredShiftTypeID" char(20) NOT NULL ,"PersonID" char(20) NULL ,"ShiftTemplateGroupID" char(20) NULL ,"Created" timestamp NULL DEFAULT current timestamp ,"Weighting" tinyint NULL ,PRIMARY KEY ("AutoMatchPersonPreferredShiftTypeID" ASC) ) go COMMENT ON TABLE "pears"."AutoMatchPersonPreferredShiftType" IS 'Preferred shift template group' go ALTER TABLE "pears"."AutoMatchPersonPreferredShiftType" ADD FOREIGN KEY "Person" ("PersonID" ASC) REFERENCES "pears"."Person" ("personid") ON DELETE CASCADE go ALTER TABLE "pears"."AutoMatchPersonPreferredShiftType" ADD FOREIGN KEY "ShiftTemplateGroup" ("ShiftTemplateGroupID" ASC) REFERENCES "pears"."ShiftTemplateGroup" ("ShiftTemplateGroupID") ON DELETE CASCADE go