default

Romber

Database tables

romber_location.regions

Purpose

This table provides a list of valid regions by which countries can be collected.

Definition

Source romber_regions_tbl.sql

create table romber_location.regions (
  currency_id           romber_base.currency_id         not null,
  region_code           romber_base.generic_code        not null,
  region_id             romber_location.location_id     not null
                          default nextval ( 'romber_base.generic_id_seq' ),
  region_name           romber_base.generic_name        not null,
  region_type_id        romber_location.location_id     not null );

Constraints

Source romber_regions_pk.sql

alter table romber_location.regions
  add constraint romber_regions_pk
    primary key ( region_id );

Source romber_regions_uk1.sql

alter table romber_location.regions
  add constraint romber_regions_uk1
    unique (
      region_type_id,
      region_code );

Source romber_regions_uk2.sql

alter table romber_location.regions
  add constraint romber_regions_uk2
    unique (
      region_type_id,
      region_name );

Source romber_regions_fk1.sql

alter table romber_location.regions
  add constraint romber_regions_fk1
    foreign key ( region_type_id )
    references romber_location.region_types ( region_type_id );

Source romber_regions_fk2.sql

alter table romber_location.regions
  add constraint romber_regions_fk2
    foreign key ( currency_id )
    references romber_base.currencies ( currency_id );

Source romber_regions_fk3.sql

alter table romber_location.regions
  add constraint romber_regions_fk3
    foreign key ( region_id )
    references romber_location.locations ( location_id );

 

Copyright © Corpita Pty Ltd 1987 - 2024

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