pears.PersonWillingness
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Description
Peak Integration - how willing is someone to work. Generated by 3rd party and sent to IQX
Columns
| Column | Type | Null | Default | Comment |
|---|---|---|---|---|
| PersonID | char(20) | NOT NULL | ||
| Willingness | smallint | NULL | ||
| WhenUpdated | timestamp | NOT NULL | current timestamp |
Primary Key
- PersonID
Foreign Keys
| Constraint | Columns | References | Delete/update action |
|---|---|---|---|
| person | PersonID | pears.Person (personid) | NOT NULL; ON DELETE CASCADE |
Referenced By
- No incoming foreign keys found.
Indexes
- No indexes found.
Triggers
| Name | Timing | Event |
|---|---|---|
| WillingnessHistoryUpdate | after | update of “Willingness” order 1 |
| WillingnessHistoryDelete | after | delete order 1 |
Original SQL
-- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."PersonWillingness" -- Table comment: Peak Integration - how willing is someone to work. Generated by 3rd party and sent to IQX -- Statement count: 7 CREATE TABLE "pears"."PersonWillingness" ( "PersonID" CHAR(20) NOT NULL ,"Willingness" SMALLINT NULL ,"WhenUpdated" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP ,PRIMARY KEY ("PersonID" ASC) ) GO COMMENT ON TABLE "pears"."PersonWillingness" IS 'Peak Integration - how willing is someone to work. Generated by 3rd party and sent to IQX' GO ALTER TABLE "pears"."PersonWillingness" ADD NOT NULL FOREIGN KEY "person" ("PersonID" ASC) REFERENCES "pears"."Person" ("personid") ON DELETE CASCADE GO CREATE TRIGGER "WillingnessHistoryUpdate" after UPDATE OF "Willingness" ORDER 1 ON "pears"."PersonWillingness" REFERENCING OLD AS "oldrec" NEW AS "newrec" FOR each ROW WHEN("isnull"("oldrec"."Willingness",11) <> "newrec"."Willingness") BEGIN INSERT INTO "PersonWillingnessHistory"( "PersonID","Willingness" ) VALUES( "oldrec"."PersonID","newrec"."Willingness" ) END GO COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."PersonWillingness"."WillingnessHistoryUpdate" IS {CREATE TRIGGER WillingnessHistoryUpdate after UPDATE OF "Willingness" ORDER 1 ON "pears"."PersonWillingness" REFERENCING OLD AS "oldrec" NEW AS "newrec" FOR each ROW WHEN("isnull"("oldrec"."Willingness",11) <> "newrec"."Willingness") BEGIN INSERT INTO "PersonWillingnessHistory"( "PersonID","Willingness" ) VALUES( "oldrec"."PersonID","newrec"."Willingness" ) END } GO CREATE TRIGGER "WillingnessHistoryDelete" after DELETE ORDER 1 ON "pears"."PersonWillingness" REFERENCING OLD AS "oldrec" FOR each ROW BEGIN INSERT INTO "PersonWillingnessHistory"( "PersonID","Willingness" ) VALUES( "oldrec"."PersonID",NULL ) END GO COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."PersonWillingness"."WillingnessHistoryDelete" IS {CREATE TRIGGER WillingnessHistoryDelete after DELETE ORDER 1 ON "pears"."PersonWillingness" REFERENCING OLD AS "oldrec" FOR each ROW BEGIN INSERT INTO "PersonWillingnessHistory"( "PersonID","Willingness" ) VALUES( "oldrec"."PersonID",NULL ) END } GO