Table of Contents



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

Foreign Keys

Constraint Columns References Delete/update action
Staff Staffid pears.staff (staffid) ON DELETE CASCADE
Parent Parent pears.Favourites (FavouritesID) ON DELETE SET NULL

Referenced By

Table Constraint Columns Referenced columns
pears.Favourites Parent Parent FavouritesID

Indexes

Triggers

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