default

Romber

Database tables

romber_location.region_countries

Purpose

This table provides a list of countries for each region. This information is highly dynamic and does need a data entry page.

Definition

Source romber_region_countries_tbl.sql

create table romber_location.region_countries (
  business_id           romber_base.business_id         not null,
  country_id            romber_location.location_id     not null,
  region_id             romber_location.location_id     not null,
  valid_begin_timestamp romber_base.generic_timestamp   not null,
  valid_end_timestamp   romber_base.generic_timestamp   not null );

Constraints

Source romber_region_countries_pk.sql

alter table romber_location.region_countries
  add constraint romber_region_countries_pk
    primary key (
      region_id,
      valid_begin_timestamp,
      country_id,
      business_id );

Source romber_region_countries_fk1.sql

alter table romber_location.region_countries
  add constraint romber_region_countries_fk1
    foreign key ( region_id )
    references romber_location.regions ( region_id );

Source romber_region_countries_fk2.sql

alter table romber_location.region_countries
  add constraint romber_region_countries_fk2
    foreign key ( country_id )
    references romber_location.countries ( country_id );

Source romber_region_countries_fk3.sql

alter table romber_location.region_countries
  add constraint romber_region_countries_fk3
    foreign key ( business_id )
    references romber_base.businesses ( business_id );

 

Copyright © Corpita Pty Ltd 1987 - 2024

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