pears.CISCard

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

Construction Industry Scheme Contractor details

Column Type Null Default Comment
Deleted smallint NOT NULL 0
TransferBatch integer NULL
DeletedTransferBatch integer NULL
StartDate date NOT NULL
EndDate date NULL
CISCardID char(20) NOT NULL
PersonID char(20) NOT NULL
CertificateNumber char(13) NOT NULL
CISType char(10) NOT NULL
ActingFor char(26) NOT NULL
AuthUser char(16) NOT NULL
CreatedBy char(20) NULL
DeletedBy char(20) NULL
WhenEntered timestamp NOT NULL
WhenDeleted timestamp NULL
  • CISCardID
Constraint Columns References Delete/update action
Person PersonID pears.Person (personid) NOT NULL; ON DELETE CASCADE
CreatedByStaff CreatedBy pears.staff (staffid) ON DELETE SET NULL
DeletedByStaff DeletedBy pears.staff (staffid) ON DELETE SET NULL
  • No incoming foreign keys found.
Name Type Columns Detail
CISTransfer Index TransferBatch
CISCardDeletion Index DeletedTransferBatch
  • No triggers found.
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."CISCard"
-- Table comment: Construction Industry Scheme Contractor details
-- Statement count: 7
 
CREATE TABLE "pears"."CISCard" (
    "Deleted"                        SMALLINT NOT NULL DEFAULT 0
   ,"TransferBatch"                  INTEGER NULL
   ,"DeletedTransferBatch"           INTEGER NULL
   ,"StartDate"                      DATE NOT NULL
   ,"EndDate"                        DATE NULL
   ,"CISCardID"                      CHAR(20) NOT NULL
   ,"PersonID"                       CHAR(20) NOT NULL
   ,"CertificateNumber"              CHAR(13) NOT NULL
   ,"CISType"                        CHAR(10) NOT NULL
   ,"ActingFor"                      CHAR(26) NOT NULL
   ,"AuthUser"                       CHAR(16) NOT NULL
   ,"CreatedBy"                      CHAR(20) NULL
   ,"DeletedBy"                      CHAR(20) NULL
   ,"WhenEntered"                    TIMESTAMP NOT NULL
   ,"WhenDeleted"                    TIMESTAMP NULL
   ,PRIMARY KEY ("CISCardID" ASC) 
)
GO
 
 
COMMENT ON TABLE "pears"."CISCard" IS 
	'Construction Industry Scheme Contractor details'
GO
 
 
ALTER TABLE "pears"."CISCard"
    ADD NOT NULL FOREIGN KEY "Person" ("PersonID" ASC)
    REFERENCES "pears"."Person" ("personid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."CISCard"
    ADD FOREIGN KEY "CreatedByStaff" ("CreatedBy" ASC)
    REFERENCES "pears"."staff" ("staffid")
    ON DELETE SET NULL
GO
 
 
ALTER TABLE "pears"."CISCard"
    ADD FOREIGN KEY "DeletedByStaff" ("DeletedBy" ASC)
    REFERENCES "pears"."staff" ("staffid")
    ON DELETE SET NULL
GO
 
 
CREATE INDEX "CISTransfer" ON "pears"."CISCard"
    ( "TransferBatch" )
GO
 
 
CREATE INDEX "CISCardDeletion" ON "pears"."CISCard"
    ( "DeletedTransferBatch" )
GO
  • database/tables/pears_ciscard.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1