====== pears.vacancy_team ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Allows additional Staff records to be linked to Vacancy records
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **vacancyid** | char(20) | NOT NULL | | |
| **staffid** | char(20) | NOT NULL | | |
===== Primary Key =====
* vacancyid, staffid
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| vacancy | vacancyid | [[database:tables:pears_vacancy|pears.vacancy (vacancyid)]] | NOT NULL; ON DELETE CASCADE |
| staff | staffid | [[database:tables:pears_staff|pears.staff (staffid)]] | NOT NULL; ON DELETE CASCADE |
===== 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"."vacancy_team"
-- Table comment: Allows additional Staff records to be linked to Vacancy records
-- Statement count: 4
CREATE TABLE "pears"."vacancy_team" (
"vacancyid" char(20) NOT NULL
,"staffid" char(20) NOT NULL
,PRIMARY KEY ("vacancyid" ASC,"staffid" ASC)
)
go
COMMENT ON TABLE "pears"."vacancy_team" IS
'Allows additional Staff records to be linked to Vacancy records'
go
ALTER TABLE "pears"."vacancy_team"
ADD NOT NULL FOREIGN KEY "vacancy" ("vacancyid" ASC)
REFERENCES "pears"."vacancy" ("vacancyid")
ON DELETE CASCADE
go
ALTER TABLE "pears"."vacancy_team"
ADD NOT NULL FOREIGN KEY "staff" ("staffid" ASC)
REFERENCES "pears"."staff" ("staffid")
ON DELETE CASCADE
go