default

Romber

Database tables

romber_location.thoroughfares

Purpose

This table provides a list of valid thoroughfares. This information is fairly static and requires its own data entry page.

Definition

Source romber_thoroughfares_tbl.sql

create table romber_location.thoroughfares (
  locality_id                   romber_location.location_id     not null,
  thoroughfare_id               romber_location.location_id     not null,
  thoroughfare_name_id          romber_location.location_id     not null,
  thoroughfare_suffix_id        romber_location.location_id     not null,
  thoroughfare_type_id          romber_location.location_id     not null );

Constraints

Source romber_thoroughfares_pk.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_pk
    primary key ( thoroughfare_id );

Source romber_thoroughfares_uk1.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_uk1
    unique (
      locality_id,
      thoroughfare_name_id,
      thoroughfare_type_id,
      thoroughfare_suffix_id );

Source romber_thoroughfares_fk1.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_fk1
    foreign key ( thoroughfare_id )
    references romber_location.locations ( location_id );

Source romber_thoroughfares_fk2.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_fk2
    foreign key ( locality_id )
    references romber_location.localities ( locality_id );

Source romber_thoroughfares_fk3.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_fk3
    foreign key ( thoroughfare_name_id )
    references romber_location.thoroughfare_names ( thoroughfare_name_id );

Source romber_thoroughfares_fk4.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_fk4
    foreign key ( thoroughfare_suffix_id )
    references romber_location.thoroughfare_suffices ( thoroughfare_suffix_id );

Source romber_thoroughfares_fk5.sql

alter table romber_location.thoroughfares
  add constraint romber_thoroughfares_fk5
    foreign key ( thoroughfare_type_id )
    references romber_location.thoroughfare_types ( thoroughfare_type_id );

 

Copyright © Corpita Pty Ltd 1987 - 2024

Developed by romber.net
Page modified on 28-Apr-2023