====== pears.ReportDepartment ======
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 ^
| **ReportDepartmentid** | char(20) | NOT NULL | | |
| Reportid | char(20) | NULL | | |
| departmentid | char(2) | NULL | | |
===== Primary Key =====
* ReportDepartmentid
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| Report | Reportid | [[database:tables:pears_report|pears.report (reportid)]] | ON DELETE CASCADE |
| department | departmentid | [[database:tables:pears_department|pears.Department (departmentid)]] | ON DELETE CASCADE |
===== Referenced By =====
* No incoming foreign keys found.
===== Indexes =====
^ Name ^ Type ^ Columns ^ Detail ^
| ReportDepartmentid | Unique index | Reportid, departmentid | |
===== Triggers =====
* No triggers found.
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."ReportDepartment"
-- Table comment:
-- Statement count: 4
CREATE TABLE "pears"."ReportDepartment" (
"ReportDepartmentid" char(20) NOT NULL
,"Reportid" char(20) NULL
,"departmentid" char(2) NULL
,PRIMARY KEY ("ReportDepartmentid" ASC)
)
go
ALTER TABLE "pears"."ReportDepartment"
ADD FOREIGN KEY "Report" ("Reportid" ASC)
REFERENCES "pears"."report" ("reportid")
ON DELETE CASCADE
go
ALTER TABLE "pears"."ReportDepartment"
ADD FOREIGN KEY "department" ("departmentid" ASC)
REFERENCES "pears"."Department" ("departmentid")
ON DELETE CASCADE
go
CREATE UNIQUE INDEX "ReportDepartmentid" ON "pears"."ReportDepartment"
( "Reportid","departmentid" )
go