====== pears.PlacementExtension ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **PlacementExtensionID** | char(20) | NOT NULL | | | | **PlacementID** | char(20) | NOT NULL | | | | WhenAuthorised | timestamp | NULL | | | | WhenChanged | timestamp | NULL | | | | WhoChanged | char(20) | NULL | | | | WhoAuthorised | char(20) | NULL | | | | Notes | char(200) | NULL | | | | StartDate | date | NULL | | | | LeaveDate | date | NULL | | | | OldLeaveDate | date | NULL | | | | ReportingStartDate | date | NULL | | | | PlacementExtensionReasonID | char(20) | NULL | | | ===== Primary Key ===== * PlacementExtensionID, PlacementID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Placement | PlacementID | [[database:tables:pears_placement|pears.Placement (placementid)]] | NOT NULL; ON DELETE CASCADE | | PlacementExtensionReason | PlacementExtensionReasonID | [[database:tables:pears_placementextensionreason|pears.PlacementExtensionReason (PlacementExtensionReasonID)]] | ON DELETE SET NULL | ===== 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"."PlacementExtension" -- Table comment: -- Statement count: 3 CREATE TABLE "pears"."PlacementExtension" ( "PlacementExtensionID" char(20) NOT NULL ,"PlacementID" char(20) NOT NULL ,"WhenAuthorised" timestamp NULL ,"WhenChanged" timestamp NULL ,"WhoChanged" char(20) NULL ,"WhoAuthorised" char(20) NULL ,"Notes" char(200) NULL ,"StartDate" date NULL ,"LeaveDate" date NULL ,"OldLeaveDate" date NULL ,"ReportingStartDate" date NULL ,"PlacementExtensionReasonID" char(20) NULL ,PRIMARY KEY ("PlacementExtensionID" ASC,"PlacementID" ASC) ) go ALTER TABLE "pears"."PlacementExtension" ADD NOT NULL FOREIGN KEY "Placement" ("PlacementID" ASC) REFERENCES "pears"."Placement" ("placementid") ON DELETE CASCADE go ALTER TABLE "pears"."PlacementExtension" ADD FOREIGN KEY "PlacementExtensionReason" ("PlacementExtensionReasonID" ASC) REFERENCES "pears"."PlacementExtensionReason" ("PlacementExtensionReasonID") ON DELETE SET NULL go