====== pears.templatestorestaff ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== This table stores favourite templates that appear at top of lists ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **templateid** | char(20) | NOT NULL | | | | **staffid** | char(20) | NOT NULL | | | ===== Primary Key ===== * templateid, staffid ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | templatestore | templateid | [[database:tables:pears_templatestore|pears.templatestore (templateid)]] | NOT NULL; ON DELETE CASCADE | | staff | staffid | [[database:tables:pears_staff|pears.staff (staffid)]] | NOT NULL; 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"."templatestorestaff" -- Table comment: This table stores favourite templates that appear at top of lists -- Statement count: 4 CREATE TABLE "pears"."templatestorestaff" ( "templateid" char(20) NOT NULL ,"staffid" char(20) NOT NULL ,PRIMARY KEY ("templateid" ASC,"staffid" ASC) ) go COMMENT ON TABLE "pears"."templatestorestaff" IS 'This table stores favourite templates that appear at top of lists' go ALTER TABLE "pears"."templatestorestaff" ADD NOT NULL FOREIGN KEY "templatestore" ("templateid" ASC) REFERENCES "pears"."templatestore" ("templateid") ON DELETE CASCADE go ALTER TABLE "pears"."templatestorestaff" ADD NOT NULL FOREIGN KEY "staff" ("staffid" ASC) REFERENCES "pears"."staff" ("staffid") ON DELETE CASCADE go