====== pears.WPKPickListChoice ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Choices for WPKPickList when not defined in SQL.
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **WPKPickListID** | char(20) | NOT NULL | | |
| **WPKPickListChoiceID** | char(20) | NOT NULL | | |
| Name | char(50) | NOT NULL | | |
| SortOrder | smallint | NULL | | |
===== Primary Key =====
* WPKPickListID, WPKPickListChoiceID
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| WPKPickList | WPKPickListID | [[database:tables:pears_wpkpicklist|pears.WPKPickList (WPKPickListID)]] | NOT NULL; ON DELETE CASCADE |
===== Referenced By =====
* No incoming foreign keys found.
===== Indexes =====
* No indexes found.
===== Triggers =====
^ Name ^ Timing ^ Event ^
| WPKPickChoiceChange | after | insert,delete,update order 1 |
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."WPKPickListChoice"
-- Table comment: Choices for WPKPickList when not defined in SQL.
-- Statement count: 5
CREATE TABLE "pears"."WPKPickListChoice" (
"WPKPickListID" char(20) NOT NULL
,"WPKPickListChoiceID" char(20) NOT NULL
,"Name" char(50) NOT NULL
,"SortOrder" smallint NULL
,PRIMARY KEY ("WPKPickListID" ASC,"WPKPickListChoiceID" ASC)
)
go
COMMENT ON TABLE "pears"."WPKPickListChoice" IS
'Choices for WPKPickList when not defined in SQL.'
go
ALTER TABLE "pears"."WPKPickListChoice"
ADD NOT NULL FOREIGN KEY "WPKPickList" ("WPKPickListID" ASC)
REFERENCES "pears"."WPKPickList" ("WPKPickListID")
ON DELETE CASCADE
go
create trigger "WPKPickChoiceChange" after insert,delete,update order 1 on
"pears"."WPKPickListChoice"
referencing new as "chc"
for each row
begin
call "WPKTrackChange"('P',"chc"."WPKPickListID")
end
go
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."WPKPickListChoice"."WPKPickChoiceChange" IS
{create trigger WPKPickChoiceChange
after insert,delete,update order 1 on
WPKPickListChoice
referencing new as chc
for each row
begin
call WPKTrackChange('P',chc.WPKPickListID)
end
}
go