Table of Contents



pears.VacancyRoleAllocation

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

Description

Link table between VacancyRole - Vacancies and Staff

Columns

Column Type Null Default Comment
VacancyID char(20) NOT NULL
EmploymentID char(20) NOT NULL
VacancyRoleID char(20) NOT NULL

Primary Key

Foreign Keys

Constraint Columns References Delete/update action
employment EmploymentID pears.employment (employmentid) NOT NULL; ON DELETE CASCADE
vacancy VacancyID pears.vacancy (vacancyid) NOT NULL; ON DELETE CASCADE
VacancyRole VacancyRoleID pears.VacancyRole (VacancyRoleID) NOT NULL; ON DELETE CASCADE

Referenced By

Indexes

Triggers

Original SQL

-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."VacancyRoleAllocation"
-- Table comment: Link table between VacancyRole - Vacancies and Staff
-- Statement count: 5
 
CREATE TABLE "pears"."VacancyRoleAllocation" (
    "VacancyID"                      CHAR(20) NOT NULL
   ,"EmploymentID"                   CHAR(20) NOT NULL
   ,"VacancyRoleID"                  CHAR(20) NOT NULL
   ,PRIMARY KEY ("VacancyID" ASC,"EmploymentID" ASC,"VacancyRoleID" ASC) 
)
GO
 
 
COMMENT ON TABLE "pears"."VacancyRoleAllocation" IS 
	'Link table between VacancyRole - Vacancies and Staff'
GO
 
 
ALTER TABLE "pears"."VacancyRoleAllocation"
    ADD NOT NULL FOREIGN KEY "employment" ("EmploymentID" ASC)
    REFERENCES "pears"."employment" ("employmentid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."VacancyRoleAllocation"
    ADD NOT NULL FOREIGN KEY "vacancy" ("VacancyID" ASC)
    REFERENCES "pears"."vacancy" ("vacancyid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."VacancyRoleAllocation"
    ADD NOT NULL FOREIGN KEY "VacancyRole" ("VacancyRoleID" ASC)
    REFERENCES "pears"."VacancyRole" ("VacancyRoleID")
    ON DELETE CASCADE
GO