====== pears.Favourites ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== List of favourite records - links to company - person…. ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **FavouritesID** | char(20) | NOT NULL | | | | Parent | char(20) | NULL | | | | ID | char(20) | NULL | | | | Staffid | char(20) | NULL | | | | Description | char(60) | NULL | | | | Type | char(1) | NULL | | H=header P=person C=company E=employment | | SortOrder | integer | NULL | 0 | | ===== Primary Key ===== * FavouritesID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Staff | Staffid | [[database:tables:pears_staff|pears.staff (staffid)]] | ON DELETE CASCADE | | Parent | Parent | [[database:tables:pears_favourites|pears.Favourites (FavouritesID)]] | ON DELETE SET NULL | ===== Referenced By ===== ^ Table ^ Constraint ^ Columns ^ Referenced columns ^ | [[database:tables:pears_favourites|pears.Favourites]] | Parent | Parent | FavouritesID | ===== Indexes ===== * No indexes found. ===== Triggers ===== * No triggers found. ===== Original SQL ===== -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."Favourites" -- Table comment: List of favourite records - links to company - person…. -- Statement count: 5 CREATE TABLE "pears"."Favourites" ( "FavouritesID" char(20) NOT NULL ,"Parent" char(20) NULL ,"ID" char(20) NULL ,"Staffid" char(20) NULL ,"Description" char(60) NULL ,"Type" char(1) NULL ,"SortOrder" integer NULL DEFAULT 0 ,PRIMARY KEY ("FavouritesID" ASC) ) go COMMENT ON COLUMN "pears"."Favourites"."Type" IS 'H=header P=person C=company E=employment' go COMMENT ON TABLE "pears"."Favourites" IS 'List of favourite records - links to company - person….' go ALTER TABLE "pears"."Favourites" ADD FOREIGN KEY "Staff" ("Staffid" ASC) REFERENCES "pears"."staff" ("staffid") ON DELETE CASCADE go ALTER TABLE "pears"."Favourites" ADD FOREIGN KEY "Parent" ("Parent" ASC) REFERENCES "pears"."Favourites" ("FavouritesID") ON DELETE SET NULL go