====== pears.RecentObjects ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Record of user viewing of different database objects.
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **StaffID** | char(20) | NOT NULL | | |
| **ObjectType** | char(1) | NOT NULL | | N:ContactEvent E:Employment R:Progress T:Timesheet or ProvTimesheet |
| **ObjectID** | char(20) | NOT NULL | | |
| LastViewed | timestamp | NULL | current timestamp | |
===== Primary Key =====
* StaffID, ObjectType, ObjectID
===== Foreign Keys =====
* No outgoing foreign keys found.
===== Referenced By =====
* No incoming foreign keys found.
===== Indexes =====
^ Name ^ Type ^ Columns ^ Detail ^
| RecentObjects_StaffIDLastViewed | Index | StaffID, LastViewed | |
===== Triggers =====
* No triggers found.
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."RecentObjects"
-- Table comment: Record of user viewing of different database objects.
-- Statement count: 4
CREATE TABLE "pears"."RecentObjects" (
"StaffID" char(20) NOT NULL
,"ObjectType" char(1) NOT NULL
,"ObjectID" char(20) NOT NULL
,"LastViewed" timestamp NULL DEFAULT current timestamp
,PRIMARY KEY ("StaffID" ASC,"ObjectType" ASC,"ObjectID" ASC)
)
go
COMMENT ON COLUMN "pears"."RecentObjects"."ObjectType" IS
'N:ContactEvent E:Employment R:Progress T:Timesheet or ProvTimesheet'
go
COMMENT ON TABLE "pears"."RecentObjects" IS
'Record of user viewing of different database objects.'
go
CREATE INDEX "RecentObjects_StaffIDLastViewed" ON "pears"."RecentObjects"
( "StaffID","LastViewed" DESC )
go