pears.CompanySDS

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

Column Type Null Default Comment
CompanySDSID char(20) NOT NULL
CompanyID char(20) NULL
PersonID char(20) NULL
IR35Status smallint NOT NULL 0 outside 1 inside
EmploymentID char(20) NULL Who passed the SDS
Reason long varchar NULL
WhenEntered timestamp NULL current timestamp
WhoEntered char(20) NULL
  • CompanySDSID
Constraint Columns References Delete/update action
company CompanyID pears.Company (companyid) ON DELETE CASCADE
person PersonID pears.Person (personid) ON DELETE CASCADE
employment EmploymentID pears.employment (employmentid) ON DELETE SET NULL
  • No incoming foreign keys found.
  • No indexes found.
  • No triggers found.
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."CompanySDS"
-- Table comment: 
-- Statement count: 6
 
CREATE TABLE "pears"."CompanySDS" (
    "CompanySDSID"                   CHAR(20) NOT NULL
   ,"CompanyID"                      CHAR(20) NULL
   ,"PersonID"                       CHAR(20) NULL
   ,"IR35Status"                     SMALLINT NOT NULL
   ,"EmploymentID"                   CHAR(20) NULL
   ,"Reason"                         long VARCHAR NULL
   ,"WhenEntered"                    TIMESTAMP NULL DEFAULT CURRENT TIMESTAMP
   ,"WhoEntered"                     CHAR(20) NULL
   ,PRIMARY KEY ("CompanySDSID" ASC) 
)
GO
 
 
COMMENT ON COLUMN "pears"."CompanySDS"."IR35Status" IS 
	'0 outside 1 inside'
GO
 
 
COMMENT ON COLUMN "pears"."CompanySDS"."EmploymentID" IS 
	'Who passed the SDS'
GO
 
 
ALTER TABLE "pears"."CompanySDS"
    ADD FOREIGN KEY "company" ("CompanyID" ASC)
    REFERENCES "pears"."Company" ("companyid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."CompanySDS"
    ADD FOREIGN KEY "person" ("PersonID" ASC)
    REFERENCES "pears"."Person" ("personid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."CompanySDS"
    ADD FOREIGN KEY "employment" ("EmploymentID" ASC)
    REFERENCES "pears"."employment" ("employmentid")
    ON DELETE SET NULL
GO
  • database/tables/pears_companysds.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1