====== pears.Town ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
List of Towns used to speed address entry
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **TownID** | char(20) | NOT NULL | | |
| Name | char(30) | NOT NULL | | |
| AgencyID | char(20) | NULL | | |
| SortOrder | smallint | NULL | | |
===== Primary Key =====
* TownID
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| AgencyDetails | AgencyID | [[database:tables:pears_agencydetails|pears.agencydetails (agencyid)]] | ON DELETE CASCADE |
===== Referenced By =====
* No incoming foreign keys found.
===== Indexes =====
* No indexes found.
===== Triggers =====
^ Name ^ Timing ^ Event ^
| WPK_town_TOWN | after | insert,delete,update order 1 |
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."Town"
-- Table comment: List of Towns used to speed address entry
-- Statement count: 5
CREATE TABLE "pears"."Town" (
"TownID" char(20) NOT NULL
,"Name" char(30) NOT NULL
,"AgencyID" char(20) NULL
,"SortOrder" smallint NULL
,PRIMARY KEY ("TownID" ASC)
)
go
COMMENT ON TABLE "pears"."Town" IS
'List of Towns used to speed address entry'
go
ALTER TABLE "pears"."Town"
ADD FOREIGN KEY "AgencyDetails" ("AgencyID" ASC)
REFERENCES "pears"."agencydetails" ("agencyid")
ON DELETE CASCADE
go
create trigger "WPK_town_TOWN" after insert,delete,update order 1 on
"pears"."town"
for each statement
begin
call "WPKTrackChange"('P','TOWN')
end
go
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."Town"."WPK_town_TOWN" IS
{create trigger WPK_town_TOWN
after insert,delete,update order 1 on
town
for each statement
begin
call WPKTrackChange('P','TOWN')
end
}
go