diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8cccdeaf..075a2fe4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -15,3 +15,8 @@ If you have edited any schema files: - [ ] Run `hsds_schema.py` to update `datapackage.json` and example files + +If you are working towards a new MINOR release: + +- [ ] Update any `$id` values in schema files where appropriate +- [ ] Update the `$ref` values in `openapi.json` diff --git a/.github/workflows/build_database.yml b/.github/workflows/build_database.yml deleted file mode 100644 index 1af9bd60..00000000 --- a/.github/workflows/build_database.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Build Databases -on: - push: - branches-ignore: - - 'master' - -jobs: -# build_database_mysql: -# runs-on: ubuntu-20.04 -# services: -# mysql: -# # 8 is chosen because that matches the version of the client utils we will install -# image: mysql:8.0 -# env: -# MYSQL_ROOT_PASSWORD: 1234 -# ports: -# - 3306:3306/tcp -# options: >- -# --health-cmd "/usr/bin/mysql -h 127.0.0.1 --user=root --password=1234 --execute \"SHOW DATABASES;\"" -# --health-interval 5s -# --health-timeout 5s -# --health-retries 20 -# steps: -# - uses: actions/checkout@v4 -# - name: Setup python -# uses: actions/setup-python@v5 -# with: -# python-version: 3.9 -# architecture: x64 -# # we also need mysql-client-8.0 BUT it is installed my default -# # and if we explicitly ask for it to be safe we sometimes get package errors -# - name: Install Ubuntu libs -# run: sudo apt-get install -y graphviz graphviz-dev -# - name: Install Python libs -# run: pip install -r requirements.txt -# - name: Install Python Libs for DB work -# run: pip install -r requirements_build_database.in -# - run: MYSQL_ROOT_PASSWORD=1234 ./build_database_mysql.sh -# - run: cat database/database_mysql.sql -# - name: Check for changes -# run: | -# if git diff --exit-code; then -# echo "CHANGED=false" >>${GITHUB_ENV} -# else -# echo "CHANGED=true" >>${GITHUB_ENV} -# fi -# - name: Commit database back (if changes) -# if: env.CHANGED == 'true' -# run: | -# git config --global user.name 'Database Schema Generator' -# git config --global user.email 'hello@openreferral.org' -# git add database/database_mysql.sql -# git commit -m "Mysql Database Schema changed by automatic generation" database/database_mysql.sql -# git push - build_database_postgresql: - #needs: build_database_mysql - runs-on: ubuntu-24.04 - services: - postgresql: - # 16 is chosen because that matches the version of the client utils we will install - image: postgres:16 - env: - POSTGRES_PASSWORD: 1234 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432/tcp - steps: - - uses: actions/checkout@v4 - - name: Setup python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - architecture: x64 - # If the MySQL stage above made changes, we need to pull first - - run: git pull - - name: Install Ubuntu libs - run: | - sudo apt-get update - sudo apt-get install -y graphviz graphviz-dev postgresql-client-16 libpq-dev - - name: Install Python libs - run: pip install -r requirements.txt - - name: Install Python Libs for DB work - run: pip install -r requirements_build_database.in - - run: POSTGRESQL_PASSWORD=1234 ./build_database_postgresql.sh - - run: cat database/database_postgresql.sql - - name: Check for changes - run: | - if git diff --exit-code; then - echo "CHANGED=false" >>${GITHUB_ENV} - else - echo "CHANGED=true" >>${GITHUB_ENV} - fi - - name: Commit database back (if changes) - if: env.CHANGED == 'true' - run: | - git config --global user.name 'Database Schema Generator' - git config --global user.email 'hello@openreferral.org' - git add database/database_postgresql.sql - git commit -m "Postgresql Database Schema changed by automatic generation" database/database_postgresql.sql - git push diff --git a/build_database_mysql.sh b/build_database_mysql.sh deleted file mode 100755 index 634895c2..00000000 --- a/build_database_mysql.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -e - -# This script assumes you have: -# * Mysql client tools installed -# * The Python libraries in requirements_build_database.in installed -# * A Mysql database server running locally -# * The root password for it is in the environmental variable MYSQL_ROOT_PASSWORD -# * A database called 'test' can be created and used -# -# If you don't have a server running locally, Docker is a good way to do this. Run: -# docker run -d --name openreferral-database-dump-mysql -e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --publish 3306:3306/tcp mysql:8.0 - - -# get ready temp dir -echo "READY TEMP DIRECTORY" -mkdir -p tmp_datapackage_for_database_schemas - -# make datapackage -echo "MAKE DATAPACKAGE" -code="import os -import sys -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.insert(0, os.path.join(BASE_DIR,'python')) -import openreferral.utils -openreferral.utils.build_blank_datapackage_for_database_schemas(os.path.join(BASE_DIR, 'datapackage.json'),os.path.join(BASE_DIR, 'tmp_datapackage_for_database_schemas'))" -echo -e "$code" | python - -# Create a database -echo "CREATE A DATABASE" -mysql -h 127.0.0.1 -P 3306 -u root -p$MYSQL_ROOT_PASSWORD -e "CREATE DATABASE test" - -# Create the schema -echo "CREATE THE SCHEMA" -code="from frictionless import Package -package = Package('tmp_datapackage_for_database_schemas/datapackage.json') -package.publish('mysql://root:$MYSQL_ROOT_PASSWORD@127.0.0.1:3306/test')" -echo -e "$code" | python - -# Dump -echo "DUMP THE SCHEMA" -mysqldump -h 127.0.0.1 -P 3306 -u root -p$MYSQL_ROOT_PASSWORD --result-file=database/database_mysql.sql --no-data test - -# Remove dumped lines -echo "EDIT THE SCHEMA" -sed -i '/^\-\- Dump completed on/d' database/database_mysql.sql -sed -i '/^\-\- Server version/d' database/database_mysql.sql -sed -i '/^\-\- Host/d' database/database_mysql.sql -sed -i '/^\-\- MySQL dump/d' database/database_mysql.sql diff --git a/build_database_postgresql.sh b/build_database_postgresql.sh deleted file mode 100755 index 392d1a9c..00000000 --- a/build_database_postgresql.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -set -e - -# This script assumes you have: -# * Postgres client tools installed -# Ubuntu: sudo apt-get install -y postgresql-client libpq-dev -# * The Python libraries in requirements_build_database.in installed -# * A Postgres database server running locally -# * The postgres user password for it is in the environmental variable POSTGRESQL_PASSWORD -# * A database called 'test' can be created and used -# -# If you don't have a server running locally, Docker is a good way to do this. Run: -# docker run -d --name openreferral-database-dump-postgresql -e POSTGRES_PASSWORD=$POSTGRESQL_PASSWORD --publish 5432:5432/tcp postgres:12 -# Make sure the version of the server matches the version of the client libraries you have installed, or pg_dump will fail. - -# get ready temp dir -echo "READY TEMP DIRECTORY" -mkdir -p tmp_datapackage_for_database_schemas - -# make datapackage -echo "MAKE DATAPACKAGE" -code="import os -import sys -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.insert(0, os.path.join(BASE_DIR,'python')) -import openreferral.utils -openreferral.utils.build_blank_datapackage_for_database_schemas(os.path.join(BASE_DIR, 'datapackage.json'),os.path.join(BASE_DIR, 'tmp_datapackage_for_database_schemas'))" -echo -e "$code" | python - -# Create a database -echo "CREATE A DATABASE" -PGPASSWORD=$POSTGRESQL_PASSWORD psql -h 127.0.0.1 -p 5432 -U postgres -w -c "CREATE DATABASE test" - -# Create the schema -echo "CREATE THE SCHEMA" -code="from frictionless import Package -package = Package('tmp_datapackage_for_database_schemas/datapackage.json') -package.publish('postgresql://postgres:$POSTGRESQL_PASSWORD@127.0.0.1:5432/test')" -echo -e "$code" | python - -# Dump -echo "DUMP THE SCHEMA" -PGPASSWORD=$POSTGRESQL_PASSWORD pg_dump -h 127.0.0.1 -p 5432 -U postgres --no-password -f database/database_postgresql.sql --schema-only test - -# Remove dumped lines -echo "EDIT THE SCHEMA" -sed -i '/^\-\- Dumped by /d' database/database_postgresql.sql -sed -i '/^\-\- Dumped from /d' database/database_postgresql.sql diff --git a/database/database_mysql.sql b/database/database_mysql.sql deleted file mode 100644 index 085903f1..00000000 --- a/database/database_mysql.sql +++ /dev/null @@ -1,541 +0,0 @@ --- --- ------------------------------------------------------ - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!50503 SET NAMES utf8mb4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `accessibility` --- - -DROP TABLE IF EXISTS `accessibility`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `accessibility` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for this accessibility information. Each entry must have a unique identifier.', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier for the location of the accessibility provision.', - `description` text COMMENT 'A free text description of the assistance or infrastructure that facilitates access to clients with disabilities.', - `details` text COMMENT 'Any further details relating to the relevant accessibility arrangements at this location.', - `url` text COMMENT 'The URL of a page giving more information about the accessibility of the location.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `location_id` (`location_id`), - CONSTRAINT `accessibility_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `address` --- - -DROP TABLE IF EXISTS `address`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `address` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier of the postal address. Each postal address must have a unique identifier.', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the location for this postal address.', - `attention` text COMMENT 'The name of the person or entity whose attention should be sought at the location. These are often included as a "care of" component of an address.', - `address_1` text NOT NULL COMMENT 'The first line(s) of the address, including office, building number and street.', - `address_2` text COMMENT 'A second (additional) line of address information.', - `city` text NOT NULL COMMENT 'The city in which the address is located.', - `region` text COMMENT 'The region in which the address is located (optional).', - `state_province` text NOT NULL COMMENT 'The state or province in which the address is located.', - `postal_code` text NOT NULL COMMENT 'The postal code for the address.', - `country` text NOT NULL COMMENT 'The country in which the address is located. This should be given as an ISO 3361-1 country code (two letter abbreviation).', - `address_type` enum('physical','postal','virtual') NOT NULL COMMENT 'The type of address which may be physical, postal, or virtual.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `location_id` (`location_id`), - CONSTRAINT `address_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `attribute` --- - -DROP TABLE IF EXISTS `attribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `attribute` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier of the attribute entry. Each attribute entry should have a unique identifier.', - `link_id` text NOT NULL COMMENT 'The identifier of the entity to which this taxonomy term applies.', - `taxonomy_term_id` varchar(250) NOT NULL COMMENT 'The identifier of this taxonomy term from the taxonomy table.', - `link_type` text COMMENT 'A code taken from an enumerated open codelist to indicate what the taxonomy term describes, e.g. the service eligibility or intended audience.', - `link_entity` text NOT NULL COMMENT 'The table of the Link Identifier.', - `value` text COMMENT 'The value (if any) of an attribute.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `taxonomy_term_id` (`taxonomy_term_id`), - CONSTRAINT `attribute_ibfk_1` FOREIGN KEY (`taxonomy_term_id`) REFERENCES `taxonomy_term` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `contact` --- - -DROP TABLE IF EXISTS `contact`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `contact` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the contact. Each contact must have a unique identifier.', - `organization_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the organization for which this is a contact.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which this is a contact.', - `service_at_location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the ‘service at location’ entry, when this contact is specific to a service in a particular location.', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier for the location of the contact.', - `name` text COMMENT 'The name of the contact.', - `title` text COMMENT 'The job title of the contact.', - `department` text COMMENT 'The department that the contact is a part of.', - `email` text COMMENT 'The email address of the contact.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - KEY `location_id` (`location_id`), - KEY `service_at_location_id` (`service_at_location_id`), - KEY `organization_id` (`organization_id`), - CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`), - CONSTRAINT `contact_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`), - CONSTRAINT `contact_ibfk_3` FOREIGN KEY (`service_at_location_id`) REFERENCES `service_at_location` (`id`), - CONSTRAINT `contact_ibfk_4` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `cost_option` --- - -DROP TABLE IF EXISTS `cost_option`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `cost_option` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the cost option. Each entry must have a unique identifier', - `service_id` varchar(250) NOT NULL COMMENT 'The identifier of the services for which the entry describes the cost.', - `valid_from` date DEFAULT NULL COMMENT 'The date when this price is valid from.', - `valid_to` date DEFAULT NULL COMMENT 'The date when this price is valid to.', - `option` text COMMENT 'Conditions associated with the cost option.', - `currency` text COMMENT 'The 3 letter currency code of this cost option (expected to be gbp by Open Referral UK).', - `amount` float DEFAULT NULL COMMENT 'The cost of the option, expressed as an amount.', - `amount_description` text COMMENT 'Specific details qualifying the cost amount.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - CONSTRAINT `cost_option_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `funding` --- - -DROP TABLE IF EXISTS `funding`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `funding` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the funding. Each entry must have a unique identifier.', - `organization_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the organization in receipt of this funding.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service in receipt of this funding.', - `source` text COMMENT 'A free text description of the source of funds for this organization or service.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - KEY `organization_id` (`organization_id`), - CONSTRAINT `funding_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`), - CONSTRAINT `funding_ibfk_2` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `language` --- - -DROP TABLE IF EXISTS `language`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `language` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the language. Each entry must have a unique identifier.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which the entry describes the languages in which services are delivered.', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the location for which the entry describes the languages in which services are delivered.', - `phone_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the phone for which the entry describes the languages in which services delivered.', - `name` text COMMENT 'The name of the language in which the service is delivered.', - `code` text COMMENT 'The ISO 639-1 or ISO 639-3 code for the language.', - `note` text COMMENT 'A free text description of any additional context or services provided for this language.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `phone_id` (`phone_id`), - KEY `location_id` (`location_id`), - KEY `service_id` (`service_id`), - CONSTRAINT `language_ibfk_1` FOREIGN KEY (`phone_id`) REFERENCES `phone` (`id`), - CONSTRAINT `language_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`), - CONSTRAINT `language_ibfk_3` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `location` --- - -DROP TABLE IF EXISTS `location`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `location` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier of the location. Each location must have a unique identifier.', - `location_type` enum('physical','postal','virtual') NOT NULL COMMENT 'The type of location, which may be either physical, postal, or virtual.', - `url` text COMMENT 'If location_type is virtual, then this field represents the URL of a virtual location.', - `organization_id` varchar(250) DEFAULT NULL COMMENT 'The organization identifier for a location. This is the organization that is responsible for maintaining information about this location. The identifier of the organization should be given here. Details of the services the organization delivers at this location should be provided in the services_at_location table.', - `name` text COMMENT 'The name of the location.', - `alternate_name` text COMMENT 'An (optional) alternative name of the location.', - `description` text COMMENT 'A free text description of the location.', - `transportation` text COMMENT 'A free text description of the access to public or private transportation to and from the location.', - `latitude` float DEFAULT NULL COMMENT 'The latitude of the location expressed in decimal degrees in WGS84 datum.', - `longitude` float DEFAULT NULL COMMENT 'The longitude of the location expressed in decimal degrees in WGS84 datum.', - `external_identifier` text COMMENT 'A third party identifier for the location, which can be drawn from other services e.g. UK UPRN or what3words.', - `external_identifier_type` text COMMENT 'The scheme used for the location''s external_identifier e.g. UK UPRN or what3words.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `organization_id` (`organization_id`), - CONSTRAINT `location_ibfk_1` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `meta_table_description` --- - -DROP TABLE IF EXISTS `meta_table_description`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `meta_table_description` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the metadata description. Each entry must have a unique identifier.', - `name` text COMMENT 'The name for the metadata description.', - `language` text COMMENT 'The ISO 639-1 or ISO 639-3 code for the language of the metadata description.', - `character_set` text COMMENT 'The character set of the metadata description.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `metadata` --- - -DROP TABLE IF EXISTS `metadata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `metadata` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for this metadata. Each entry must have a unique identifier.', - `resource_id` text NOT NULL COMMENT 'The identifier of the resource (service, program, location, address, or contact) that this metadata describes.', - `resource_type` text NOT NULL COMMENT 'The type of entity being referenced.', - `last_action_date` date NOT NULL COMMENT 'The date when data was changed.', - `last_action_type` text NOT NULL COMMENT 'The kind of change made to the data.', - `field_name` text NOT NULL COMMENT 'The name of field that has been modified.', - `previous_value` text NOT NULL COMMENT 'The previous value of the field that has been modified.', - `replacement_value` text NOT NULL COMMENT 'The new value of the field that has been modified.', - `updated_by` text NOT NULL COMMENT 'The name of the person who modified the field.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `organization` --- - -DROP TABLE IF EXISTS `organization`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `organization` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the organization. Each organization must have a unique identifier.', - `name` text NOT NULL COMMENT 'The official or public name of the organization.', - `alternate_name` text COMMENT 'An (optional) alternative or commonly used name for the organization.', - `description` text NOT NULL COMMENT 'A free text description containing a brief summary about the organization. It can contain markup such as HTML or Markdown.', - `email` text COMMENT 'The contact e-mail address for the organization.', - `website` text COMMENT 'The URL (website address) of the organization.', - `tax_status` text COMMENT 'DEPRECATED: Government assigned tax designation for tax-exempt organizations.', - `tax_id` text COMMENT 'DEPRECATED: A government issued identifier used for the purpose of tax administration.', - `year_incorporated` float DEFAULT NULL COMMENT 'The year in which the organization was legally formed.', - `legal_status` text COMMENT 'The legal conditions that an organization is operating under.', - `logo` text COMMENT 'A URL to an image associated with the organization which can be presented alongside its name.', - `uri` text COMMENT 'A persistent identifier to uniquely identify the organization such as those provided by Open Corporates or some other relevant URI provider. This is not for listing the website of the organization: that can be done through the website field of the Organization.', - `parent_organization_id` text COMMENT 'The identifier of the organization''s parent organization.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `organization_identifier` --- - -DROP TABLE IF EXISTS `organization_identifier`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `organization_identifier` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for this organization identifier entry. Each entry must have a unique identifier.', - `organization_id` varchar(250) NOT NULL COMMENT 'The identifier of the organization.', - `identifier_scheme` text COMMENT 'The scheme of the third party identifier, according to http://org-id.guide/.', - `identifier_type` text NOT NULL COMMENT 'The type of the third party identifier.', - `identifier` text NOT NULL COMMENT 'The third-party identifier value', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `organization_id` (`organization_id`), - CONSTRAINT `organization_identifier_ibfk_1` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `phone` --- - -DROP TABLE IF EXISTS `phone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `phone` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the phone number. Each entry must have a unique identifier.', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the location where this phone number is located.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which this is the phone number.', - `organization_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the organization for which this is the phone number.', - `contact_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the contact for which this is the phone number.', - `service_at_location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the ‘service at location’ table entry, when this phone number is specific to a service in a particular location.', - `number` text NOT NULL COMMENT 'The phone number.', - `extension` float DEFAULT NULL COMMENT 'The extension of the phone number.', - `type` text COMMENT 'Indicates the type of phone service, drawing from the RFC6350 list of types (text (for SMS), voice, fax, cell, video, pager, textphone).', - `description` text COMMENT 'A free text description providing extra information about the phone service', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - KEY `location_id` (`location_id`), - KEY `service_at_location_id` (`service_at_location_id`), - KEY `organization_id` (`organization_id`), - KEY `contact_id` (`contact_id`), - CONSTRAINT `phone_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`), - CONSTRAINT `phone_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`), - CONSTRAINT `phone_ibfk_3` FOREIGN KEY (`service_at_location_id`) REFERENCES `service_at_location` (`id`), - CONSTRAINT `phone_ibfk_4` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`), - CONSTRAINT `phone_ibfk_5` FOREIGN KEY (`contact_id`) REFERENCES `contact` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `program` --- - -DROP TABLE IF EXISTS `program`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `program` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the program. Each program must have a unique identifier.', - `organization_id` varchar(250) NOT NULL COMMENT 'The identifier for the organization which the program belongs to. Each program must belong to a single organization, and the identifier for that organization should be given here.', - `name` text NOT NULL COMMENT 'The name of the program.', - `alternate_name` text COMMENT 'The (optional) alternative name for the program.', - `description` text NOT NULL COMMENT 'A free text description of the program', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - UNIQUE KEY `organization_id` (`organization_id`), - CONSTRAINT `program_ibfk_1` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `required_document` --- - -DROP TABLE IF EXISTS `required_document`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `required_document` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the document. Each document must have a unique identifier.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which this entry describes the required document.', - `document` text COMMENT 'A free text description of the document required to apply for or receive the service.', - `uri` text COMMENT 'A web link to the document.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - CONSTRAINT `required_document_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `schedule` --- - -DROP TABLE IF EXISTS `schedule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `schedule` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the schedule. Each entry must have a unique identifier.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which this is the regular schedule', - `location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the location for which this is the regular schedule', - `service_at_location_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the ‘service at location’ table entry, when this schedule is specific to a service in a particular location.', - `valid_from` date DEFAULT NULL COMMENT 'The date from which the schedule information is valid. It must be in the ISO 8601 format of YYYY-MM-DD,', - `valid_to` date DEFAULT NULL COMMENT 'The last date on which the schedule information is valid. It must be in the ISO 8601 format of YYYY-MM-DD.', - `dtstart` date DEFAULT NULL COMMENT 'iCal - The date of the first event is the schedule. Necessary when using the ‘interval’ feature, optional otherwise.', - `timezone` float DEFAULT NULL COMMENT 'The timezone that all dates are expressed as, expressed as a UTC offset. Dates are assumed to be UTC otherwise.', - `until` date DEFAULT NULL COMMENT 'iCal - The date of the last occurrence of the recurring event.', - `count` float DEFAULT NULL COMMENT 'iCal - The number of times that the event occurs. Use this instead of ‘until’, if appropriate.', - `wkst` enum('MO','TU','WE','TH','FR','SA','SU') DEFAULT NULL COMMENT 'iCal - The two-letter code for the day on which the week starts.', - `freq` enum('WEEKLY','MONTHLY') DEFAULT NULL COMMENT 'iCal - How often the frequency repeats.', - `interval` float DEFAULT NULL COMMENT 'iCal - How often the frequency repeats. For example, and Interval of 2 for a WEEKLY Frequency would represent fortnightly.', - `byday` text COMMENT 'iCal - Comma separated days of the week. Where freq is MONTHLY each part can be preceded by a positive or negative integer to represent which occurrence in a month; e.g. 2MO is the second Monday in a month. -1FR is the last Friday', - `byweekno` text COMMENT 'iCal - Comma separated numeric weeks of the year, where freq is WEEKLY. Can be negative to represent weeks before the end of the year; e.g. -5 is the 5th to last week in a year.', - `bymonthday` text COMMENT 'iCal - Comma separated numeric days of the month, where frequency is MONTHLY. Can be negative to represent days before the end of the month; e.g. -5 is the 5th to last day in a month.', - `byyearday` text COMMENT 'iCal - Comma separated numeric days of the month, where frequency is YEARLY. Can be negative to represent days before the end of the year; e.g. -1 is the last day in a year.', - `description` text COMMENT 'A free text description of the availability of the service.', - `opens_at` time DEFAULT NULL COMMENT 'The time when a service or location opens. This should use HH:MM format and should include timezone information, either adding the suffix ‘Z’ when the date is in UTC, or including an offset from UTC (e.g. 09:00-05:00 for 9am EST.)', - `closes_at` time DEFAULT NULL COMMENT 'The time when a service or location closes. This should use HH:MM format and should include timezone information, either adding the suffix ‘Z’ when the date is in UTC, or including an offset from UTC (e.g. 09:00-05:00 for 9am EST.).', - `schedule_link` text COMMENT 'URL of a link for the schedule which may show each individual session and may provide a booking facility.', - `attending_type` text COMMENT 'A free text description of how to attend this service.', - `notes` text COMMENT 'Free text notes on the schedule.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - KEY `service_at_location_id` (`service_at_location_id`), - KEY `location_id` (`location_id`), - CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`), - CONSTRAINT `schedule_ibfk_2` FOREIGN KEY (`service_at_location_id`) REFERENCES `service_at_location` (`id`), - CONSTRAINT `schedule_ibfk_3` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `service` --- - -DROP TABLE IF EXISTS `service`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `service` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the service. Each service must have a unique identifier.', - `organization_id` varchar(250) NOT NULL COMMENT 'The identifier of the organization that provides this service.', - `program_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the program this service is delivered under.', - `name` text NOT NULL COMMENT 'The official or public name of the service.', - `alternate_name` text COMMENT 'An (optional) alternative name for this service.', - `description` text COMMENT 'A free text description of the service.', - `url` text COMMENT 'URL of the service', - `email` text COMMENT 'An email address which can be used to contact the service provider.', - `status` enum('active','inactive','defunct','temporarily closed') NOT NULL COMMENT 'The current status of the service which can be active, inactive, defunct, or temporarily closed.', - `interpretation_services` text COMMENT 'A free text description of any interpretation services available for accessing this service.', - `application_process` text COMMENT 'A free text description of the steps needed to access this service.', - `fees_description` text COMMENT 'A free text description of any charges for service users to access this service.', - `wait_time` text COMMENT 'DEPRECATED: The time a client may expect to wait before receiving a service.', - `fees` text COMMENT 'DEPRECATED: Details of any charges for service users to access this service.', - `accreditations` text COMMENT 'A free text description of any accreditations. Accreditation is the formal evaluation of an organization or program against best practice standards set by an accrediting organization.', - `eligibility_description` text COMMENT 'A free text description of the type of person for whom this service is intended.', - `minimum_age` float DEFAULT NULL COMMENT 'The minimum age of a person required to meet this eligibility requirement.', - `maximum_age` float DEFAULT NULL COMMENT 'The maximum age of a person required to meet this eligibility requirement.', - `assured_date` date DEFAULT NULL COMMENT 'The date that the information about the service was last checked.', - `assurer_email` text COMMENT 'The contact e-mail address for the person or organization which last assured the service.', - `licenses` text COMMENT 'DEPRECATED: An organization may have a license issued by a government entity to operate legally. A list of any such licenses can be provided here.', - `alert` text COMMENT 'A description of any short term alerts concerning the service.', - `last_modified` datetime DEFAULT NULL COMMENT 'The datetime when the service, or any related information about the service, has changed. Should have millisecond accuracy.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `program_id` (`program_id`), - KEY `organization_id` (`organization_id`), - CONSTRAINT `service_ibfk_1` FOREIGN KEY (`program_id`) REFERENCES `program` (`id`), - CONSTRAINT `service_ibfk_2` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `service_area` --- - -DROP TABLE IF EXISTS `service_area`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `service_area` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for the service area. Each service area must have a unique identifier.', - `service_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the service for which this entry describes the service area', - `name` text COMMENT 'A free text geographic area where a service is available.', - `description` text COMMENT 'A more detailed free text description of this service area. Used to provide any additional information that cannot be communicated using the structured area and geometry fields.', - `extent` text COMMENT 'A definition of the polygon defining the area.', - `extent_type` text COMMENT 'The format of the extent field populated from an enum of "geojson", "topojson", "kml",and (for legacy systems or early state during transformation) "text".', - `uri` text COMMENT 'A URI which acts as a persistent identifier to identify an area.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - CONSTRAINT `service_area_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `service_at_location` --- - -DROP TABLE IF EXISTS `service_at_location`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `service_at_location` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier of the service at location entry. Each entry must have a unique identifier.', - `service_id` varchar(250) NOT NULL COMMENT 'The identifier of the service at a given location.', - `location_id` varchar(250) NOT NULL COMMENT 'The identifier of the location where this service operates.', - `description` text COMMENT 'A free text description of the service at this specific location.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `service_id` (`service_id`), - KEY `location_id` (`location_id`), - CONSTRAINT `service_at_location_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`), - CONSTRAINT `service_at_location_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `taxonomy` --- - -DROP TABLE IF EXISTS `taxonomy`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `taxonomy` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier of the taxonomy. Each entry must have a unique identifier', - `name` text NOT NULL COMMENT 'The name of the taxonomy from which terms are sourced.', - `description` text NOT NULL COMMENT 'A free text description of the taxonomy.', - `uri` text COMMENT 'The URI of the taxonomy.', - `version` text COMMENT 'The version of the taxonomy.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `taxonomy_term` --- - -DROP TABLE IF EXISTS `taxonomy_term`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `taxonomy_term` ( - `id` varchar(250) NOT NULL COMMENT 'The identifier for this taxonomy term. Each taxonomy term must have a unique identifier, within the scope of the dataset.', - `code` text COMMENT 'The term identfier as used in the taxonomy. This and the taxonomy_id combined define the term.', - `name` text NOT NULL COMMENT 'The taxonomy term itself.', - `description` text NOT NULL COMMENT 'A free text description of the term.', - `parent_id` text COMMENT 'If this is a child term in a hierarchical taxonomy, give the identifier of the parent category. For top-level categories, this is not required.', - `taxonomy` text COMMENT 'If this is an established taxonomy, a free text description of which taxonomy is in use. If possible, provide a URI.', - `language` text COMMENT 'An ISO 639-1, or ISO 639-2 [language code](available at http://www.loc.gov/standards/iso639-2/php/code_list.php) to represent the language of the term. The three-letter codes from ISO 639-2 provide greater accuracy when describing variants of languages, which may be relevant to particular communities.', - `taxonomy_id` varchar(250) DEFAULT NULL COMMENT 'The identifier of the taxonomy containing the term.', - `term_uri` text COMMENT 'URI of the term.', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `taxonomy_id` (`taxonomy_id`), - CONSTRAINT `taxonomy_term_ibfk_1` FOREIGN KEY (`taxonomy_id`) REFERENCES `taxonomy` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - diff --git a/database/database_postgresql.sql b/database/database_postgresql.sql deleted file mode 100644 index 00a6ccbe..00000000 --- a/database/database_postgresql.sql +++ /dev/null @@ -1,2449 +0,0 @@ --- --- PostgreSQL database dump --- - -\restrict YN7tVkxQMepU09IbFJeeuZLuqBxv1hbK7hOiMQNQe3FuYb9VIciZWSe7ROol6aW - - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- Name: address_address_type_enum; Type: TYPE; Schema: public; Owner: postgres --- - -CREATE TYPE public.address_address_type_enum AS ENUM ( - 'physical', - 'postal', - 'virtual' -); - - -ALTER TYPE public.address_address_type_enum OWNER TO postgres; - --- --- Name: location_location_type_enum; Type: TYPE; Schema: public; Owner: postgres --- - -CREATE TYPE public.location_location_type_enum AS ENUM ( - 'physical', - 'postal', - 'virtual' -); - - -ALTER TYPE public.location_location_type_enum OWNER TO postgres; - --- --- Name: schedule_freq_enum; Type: TYPE; Schema: public; Owner: postgres --- - -CREATE TYPE public.schedule_freq_enum AS ENUM ( - 'WEEKLY', - 'MONTHLY' -); - - -ALTER TYPE public.schedule_freq_enum OWNER TO postgres; - --- --- Name: schedule_wkst_enum; Type: TYPE; Schema: public; Owner: postgres --- - -CREATE TYPE public.schedule_wkst_enum AS ENUM ( - 'MO', - 'TU', - 'WE', - 'TH', - 'FR', - 'SA', - 'SU' -); - - -ALTER TYPE public.schedule_wkst_enum OWNER TO postgres; - --- --- Name: service_status_enum; Type: TYPE; Schema: public; Owner: postgres --- - -CREATE TYPE public.service_status_enum AS ENUM ( - 'active', - 'inactive', - 'defunct', - 'temporarily closed' -); - - -ALTER TYPE public.service_status_enum OWNER TO postgres; - -SET default_tablespace = ''; - -SET default_table_access_method = heap; - --- --- Name: accessibility; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.accessibility ( - id character varying(250) NOT NULL, - location_id character varying(250), - description text, - details text, - url text -); - - -ALTER TABLE public.accessibility OWNER TO postgres; - --- --- Name: COLUMN accessibility.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.accessibility.id IS 'The identifier for this accessibility information. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN accessibility.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.accessibility.location_id IS 'The identifier for the location of the accessibility provision.'; - - --- --- Name: COLUMN accessibility.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.accessibility.description IS 'A free text description of the assistance or infrastructure that facilitates access to clients with disabilities.'; - - --- --- Name: COLUMN accessibility.details; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.accessibility.details IS 'Any further details relating to the relevant accessibility arrangements at this location.'; - - --- --- Name: COLUMN accessibility.url; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.accessibility.url IS 'The URL of a page giving more information about the accessibility of the location.'; - - --- --- Name: address; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.address ( - id character varying(250) NOT NULL, - location_id character varying(250), - attention text, - address_1 text NOT NULL, - address_2 text, - city text NOT NULL, - region text, - state_province text NOT NULL, - postal_code text NOT NULL, - country text NOT NULL, - address_type public.address_address_type_enum NOT NULL -); - - -ALTER TABLE public.address OWNER TO postgres; - --- --- Name: COLUMN address.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.id IS 'The identifier of the postal address. Each postal address must have a unique identifier.'; - - --- --- Name: COLUMN address.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.location_id IS 'The identifier of the location for this postal address.'; - - --- --- Name: COLUMN address.attention; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.attention IS 'The name of the person or entity whose attention should be sought at the location. These are often included as a "care of" component of an address.'; - - --- --- Name: COLUMN address.address_1; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.address_1 IS 'The first line(s) of the address, including office, building number and street.'; - - --- --- Name: COLUMN address.address_2; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.address_2 IS 'A second (additional) line of address information.'; - - --- --- Name: COLUMN address.city; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.city IS 'The city in which the address is located.'; - - --- --- Name: COLUMN address.region; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.region IS 'The region in which the address is located (optional).'; - - --- --- Name: COLUMN address.state_province; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.state_province IS 'The state or province in which the address is located.'; - - --- --- Name: COLUMN address.postal_code; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.postal_code IS 'The postal code for the address.'; - - --- --- Name: COLUMN address.country; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.country IS 'The country in which the address is located. This should be given as an ISO 3361-1 country code (two letter abbreviation).'; - - --- --- Name: COLUMN address.address_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.address.address_type IS 'The type of address which may be `physical`, `postal`, or `virtual`.'; - - --- --- Name: attribute; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.attribute ( - id character varying(250) NOT NULL, - link_id text NOT NULL, - taxonomy_term_id character varying(250) NOT NULL, - link_type text, - link_entity text NOT NULL, - value text, - label text -); - - -ALTER TABLE public.attribute OWNER TO postgres; - --- --- Name: COLUMN attribute.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.id IS 'The identifier of the attribute entry. Each attribute entry should have a unique identifier.'; - - --- --- Name: COLUMN attribute.link_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.link_id IS 'The identifier of the entity to which this taxonomy term applies.'; - - --- --- Name: COLUMN attribute.taxonomy_term_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.taxonomy_term_id IS 'The identifier of this taxonomy term from the taxonomy table.'; - - --- --- Name: COLUMN attribute.link_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.link_type IS 'A code taken from an enumerated open codelist to indicate what the taxonomy term describes, e.g. the service eligibility or intended audience.'; - - --- --- Name: COLUMN attribute.link_entity; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.link_entity IS 'The table of the Link Identifier.'; - - --- --- Name: COLUMN attribute.value; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.value IS 'The value (if any) of an attribute.'; - - --- --- Name: COLUMN attribute.label; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.attribute.label IS 'A free text label of the attribute.'; - - --- --- Name: contact; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.contact ( - id character varying(250) NOT NULL, - organization_id character varying(250), - service_id character varying(250), - service_at_location_id character varying(250), - location_id character varying(250), - name text, - title text, - department text, - email text -); - - -ALTER TABLE public.contact OWNER TO postgres; - --- --- Name: COLUMN contact.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.id IS 'The identifier for the contact. Each contact must have a unique identifier.'; - - --- --- Name: COLUMN contact.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.organization_id IS 'The identifier of the organization for which this is a contact.'; - - --- --- Name: COLUMN contact.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.service_id IS 'The identifier of the service for which this is a contact.'; - - --- --- Name: COLUMN contact.service_at_location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.service_at_location_id IS 'The identifier of the ‘service at location’ entry, when this contact is specific to a service in a particular location.'; - - --- --- Name: COLUMN contact.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.location_id IS 'The identifier for the location of the contact.'; - - --- --- Name: COLUMN contact.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.name IS 'The name of the contact.'; - - --- --- Name: COLUMN contact.title; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.title IS 'The job title of the contact.'; - - --- --- Name: COLUMN contact.department; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.department IS 'The department that the contact is a part of.'; - - --- --- Name: COLUMN contact.email; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.contact.email IS 'The email address of the contact.'; - - --- --- Name: cost_option; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.cost_option ( - id character varying(250) NOT NULL, - service_id character varying(250) NOT NULL, - valid_from date, - valid_to date, - option text, - currency text, - amount numeric, - amount_description text -); - - -ALTER TABLE public.cost_option OWNER TO postgres; - --- --- Name: COLUMN cost_option.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.id IS 'The identifier for the cost option. Each entry must have a unique identifier'; - - --- --- Name: COLUMN cost_option.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.service_id IS 'The identifier of the services for which the entry describes the cost.'; - - --- --- Name: COLUMN cost_option.valid_from; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.valid_from IS 'The date when this price is valid from.'; - - --- --- Name: COLUMN cost_option.valid_to; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.valid_to IS 'The date when this price is valid to.'; - - --- --- Name: COLUMN cost_option.option; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.option IS 'Conditions associated with the cost option.'; - - --- --- Name: COLUMN cost_option.currency; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.currency IS 'The 3 letter currency code of this cost option (expected to be gbp by Open Referral UK).'; - - --- --- Name: COLUMN cost_option.amount; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.amount IS 'The cost of the option, expressed as an amount.'; - - --- --- Name: COLUMN cost_option.amount_description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.cost_option.amount_description IS 'Specific details qualifying the cost amount.'; - - --- --- Name: funding; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.funding ( - id character varying(250) NOT NULL, - organization_id character varying(250), - service_id character varying(250), - source text -); - - -ALTER TABLE public.funding OWNER TO postgres; - --- --- Name: COLUMN funding.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.funding.id IS 'The identifier for the funding. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN funding.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.funding.organization_id IS 'The identifier of the organization in receipt of this funding.'; - - --- --- Name: COLUMN funding.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.funding.service_id IS 'The identifier of the service in receipt of this funding.'; - - --- --- Name: COLUMN funding.source; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.funding.source IS 'A free text description of the source of funds for this organization or service.'; - - --- --- Name: language; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.language ( - id character varying(250) NOT NULL, - service_id character varying(250), - location_id character varying(250), - phone_id character varying(250), - name text, - code text, - note text -); - - -ALTER TABLE public.language OWNER TO postgres; - --- --- Name: COLUMN language.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.id IS 'The identifier for the language. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN language.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.service_id IS 'The identifier of the service for which the entry describes the languages in which services are delivered.'; - - --- --- Name: COLUMN language.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.location_id IS 'The identifier of the location for which the entry describes the languages in which services are delivered.'; - - --- --- Name: COLUMN language.phone_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.phone_id IS 'The identifier of the phone for which the entry describes the languages in which services delivered.'; - - --- --- Name: COLUMN language.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.name IS 'The name of the language in which the service is delivered.'; - - --- --- Name: COLUMN language.code; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.code IS 'The ISO 639-1 or ISO 639-3 code for the language.'; - - --- --- Name: COLUMN language.note; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.language.note IS 'A free text description of any additional context or services provided for this language.'; - - --- --- Name: location; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.location ( - id character varying(250) NOT NULL, - location_type public.location_location_type_enum NOT NULL, - url text, - organization_id character varying(250), - name text, - alternate_name text, - description text, - transportation text, - latitude numeric, - longitude numeric, - external_identifier text, - external_identifier_type text -); - - -ALTER TABLE public.location OWNER TO postgres; - --- --- Name: COLUMN location.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.id IS 'The identifier of the location. Each location must have a unique identifier.'; - - --- --- Name: COLUMN location.location_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.location_type IS 'The type of location, which may be either `physical`, `postal`, or `virtual`.'; - - --- --- Name: COLUMN location.url; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.url IS 'If location_type is virtual, then this field represents the URL of a virtual location.'; - - --- --- Name: COLUMN location.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.organization_id IS 'The organization identifier for a location. This is the organization that is responsible for maintaining information about this location. The identifier of the organization should be given here. Details of the services the organization delivers at this location should be provided in the services_at_location table.'; - - --- --- Name: COLUMN location.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.name IS 'The name of the location.'; - - --- --- Name: COLUMN location.alternate_name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.alternate_name IS 'An (optional) alternative name of the location.'; - - --- --- Name: COLUMN location.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.description IS 'A free text description of the location.'; - - --- --- Name: COLUMN location.transportation; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.transportation IS 'A free text description of the access to public or private transportation to and from the location.'; - - --- --- Name: COLUMN location.latitude; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.latitude IS 'The latitude of the location expressed in decimal degrees in WGS84 datum.'; - - --- --- Name: COLUMN location.longitude; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.longitude IS 'The longitude of the location expressed in decimal degrees in WGS84 datum.'; - - --- --- Name: COLUMN location.external_identifier; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.external_identifier IS 'A third party identifier for the location, which can be drawn from other services e.g. UK UPRN.'; - - --- --- Name: COLUMN location.external_identifier_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.location.external_identifier_type IS 'The scheme used for the location''s external_identifier e.g. UK UPRN.'; - - --- --- Name: meta_table_description; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.meta_table_description ( - id character varying(250) NOT NULL, - name text, - language text, - character_set text -); - - -ALTER TABLE public.meta_table_description OWNER TO postgres; - --- --- Name: COLUMN meta_table_description.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.meta_table_description.id IS 'The identifier for the metadata description. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN meta_table_description.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.meta_table_description.name IS 'The name for the metadata description.'; - - --- --- Name: COLUMN meta_table_description.language; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.meta_table_description.language IS 'The ISO 639-1 or ISO 639-3 code for the language of the metadata description.'; - - --- --- Name: COLUMN meta_table_description.character_set; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.meta_table_description.character_set IS 'The character set of the metadata description.'; - - --- --- Name: metadata; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.metadata ( - id character varying(250) NOT NULL, - resource_id text NOT NULL, - resource_type text NOT NULL, - last_action_date date NOT NULL, - last_action_type text NOT NULL, - field_name text NOT NULL, - previous_value text NOT NULL, - replacement_value text NOT NULL, - updated_by text NOT NULL -); - - -ALTER TABLE public.metadata OWNER TO postgres; - --- --- Name: COLUMN metadata.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.id IS 'The identifier for this metadata. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN metadata.resource_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.resource_id IS 'The identifier of the resource (service, program, location, address, or contact) that this metadata describes.'; - - --- --- Name: COLUMN metadata.resource_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.resource_type IS 'The type of entity being referenced.'; - - --- --- Name: COLUMN metadata.last_action_date; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.last_action_date IS 'The date when data was changed.'; - - --- --- Name: COLUMN metadata.last_action_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.last_action_type IS 'The kind of change made to the data.'; - - --- --- Name: COLUMN metadata.field_name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.field_name IS 'The name of field that has been modified.'; - - --- --- Name: COLUMN metadata.previous_value; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.previous_value IS 'The previous value of the field that has been modified.'; - - --- --- Name: COLUMN metadata.replacement_value; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.replacement_value IS 'The new value of the field that has been modified.'; - - --- --- Name: COLUMN metadata.updated_by; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.metadata.updated_by IS 'The name of the person who modified the field.'; - - --- --- Name: organization; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.organization ( - id character varying(250) NOT NULL, - name text NOT NULL, - alternate_name text, - description text NOT NULL, - email text, - website text, - tax_status text, - tax_id text, - year_incorporated numeric, - legal_status text, - logo text, - uri text, - parent_organization_id text -); - - -ALTER TABLE public.organization OWNER TO postgres; - --- --- Name: COLUMN organization.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.id IS 'The identifier for the organization. Each organization must have a unique identifier.'; - - --- --- Name: COLUMN organization.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.name IS 'The official or public name of the organization.'; - - --- --- Name: COLUMN organization.alternate_name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.alternate_name IS 'An (optional) alternative or commonly used name for the organization.'; - - --- --- Name: COLUMN organization.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.description IS 'A free text description containing a brief summary about the organization. It can contain markup such as HTML or Markdown.'; - - --- --- Name: COLUMN organization.email; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.email IS 'The contact e-mail address for the organization.'; - - --- --- Name: COLUMN organization.website; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.website IS 'The URL (website address) of the organization.'; - - --- --- Name: COLUMN organization.tax_status; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.tax_status IS 'DEPRECATED: Government assigned tax designation for tax-exempt organizations.'; - - --- --- Name: COLUMN organization.tax_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.tax_id IS 'DEPRECATED: A government issued identifier used for the purpose of tax administration.'; - - --- --- Name: COLUMN organization.year_incorporated; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.year_incorporated IS 'The year in which the organization was legally formed.'; - - --- --- Name: COLUMN organization.legal_status; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.legal_status IS 'The legal conditions that an organization is operating under.'; - - --- --- Name: COLUMN organization.logo; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.logo IS 'A URL to an image associated with the organization which can be presented alongside its name.'; - - --- --- Name: COLUMN organization.uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.uri IS 'A persistent identifier to uniquely identify the organization such as those provided by Open Corporates or some other relevant URI provider. This is not for listing the website of the organization: that can be done through the website field of the Organization.'; - - --- --- Name: COLUMN organization.parent_organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization.parent_organization_id IS 'The identifier of the organization''s parent organization.'; - - --- --- Name: organization_identifier; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.organization_identifier ( - id character varying(250) NOT NULL, - organization_id character varying(250) NOT NULL, - identifier_scheme text, - identifier_type text NOT NULL, - identifier text NOT NULL -); - - -ALTER TABLE public.organization_identifier OWNER TO postgres; - --- --- Name: COLUMN organization_identifier.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization_identifier.id IS 'The identifier for this organization identifier entry. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN organization_identifier.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization_identifier.organization_id IS 'The identifier of the organization. This should match the uuid of an organization object.'; - - --- --- Name: COLUMN organization_identifier.identifier_scheme; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization_identifier.identifier_scheme IS 'The scheme of the third party identifier, according to http://org-id.guide/.'; - - --- --- Name: COLUMN organization_identifier.identifier_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization_identifier.identifier_type IS 'A human-readable equivalent of the identifier_scheme. This may be used in cases where org-id.guide does not list an appropriate identifier scheme.'; - - --- --- Name: COLUMN organization_identifier.identifier; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.organization_identifier.identifier IS 'The third-party identifier value.'; - - --- --- Name: phone; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.phone ( - id character varying(250) NOT NULL, - location_id character varying(250), - service_id character varying(250), - organization_id character varying(250), - contact_id character varying(250), - service_at_location_id character varying(250), - number text NOT NULL, - extension numeric, - type text, - description text -); - - -ALTER TABLE public.phone OWNER TO postgres; - --- --- Name: COLUMN phone.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.id IS 'The identifier for the phone number. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN phone.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.location_id IS 'The identifier of the location where this phone number is located.'; - - --- --- Name: COLUMN phone.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.service_id IS 'The identifier of the service for which this is the phone number.'; - - --- --- Name: COLUMN phone.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.organization_id IS 'The identifier of the organization for which this is the phone number.'; - - --- --- Name: COLUMN phone.contact_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.contact_id IS 'The identifier of the contact for which this is the phone number.'; - - --- --- Name: COLUMN phone.service_at_location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.service_at_location_id IS 'The identifier of the ‘service at location’ table entry, when this phone number is specific to a service in a particular location.'; - - --- --- Name: COLUMN phone.number; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.number IS 'The phone number.'; - - --- --- Name: COLUMN phone.extension; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.extension IS 'The extension of the phone number.'; - - --- --- Name: COLUMN phone.type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.type IS 'Indicates the type of phone service, drawing from the RFC6350 list of types (text (for SMS), voice, fax, cell, video, pager, textphone).'; - - --- --- Name: COLUMN phone.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.phone.description IS 'A free text description providing extra information about the phone service'; - - --- --- Name: program; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.program ( - id character varying(250) NOT NULL, - organization_id character varying(250) NOT NULL, - name text NOT NULL, - alternate_name text, - description text NOT NULL -); - - -ALTER TABLE public.program OWNER TO postgres; - --- --- Name: COLUMN program.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.program.id IS 'The identifier for the program. Each program must have a unique identifier.'; - - --- --- Name: COLUMN program.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.program.organization_id IS 'The identifier for the organization which the program belongs to. Each program must belong to a single organization, and the identifier for that organization should be given here.'; - - --- --- Name: COLUMN program.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.program.name IS 'The name of the program.'; - - --- --- Name: COLUMN program.alternate_name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.program.alternate_name IS 'The (optional) alternative name for the program.'; - - --- --- Name: COLUMN program.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.program.description IS 'A free text description of the program'; - - --- --- Name: required_document; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.required_document ( - id character varying(250) NOT NULL, - service_id character varying(250), - document text, - uri text -); - - -ALTER TABLE public.required_document OWNER TO postgres; - --- --- Name: COLUMN required_document.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.required_document.id IS 'The identifier for the document. Each document must have a unique identifier.'; - - --- --- Name: COLUMN required_document.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.required_document.service_id IS 'The identifier of the service for which this entry describes the required document.'; - - --- --- Name: COLUMN required_document.document; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.required_document.document IS 'A free text description of the document required to apply for or receive the service.'; - - --- --- Name: COLUMN required_document.uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.required_document.uri IS 'A web link to the document.'; - - --- --- Name: schedule; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.schedule ( - id character varying(250) NOT NULL, - service_id character varying(250), - location_id character varying(250), - service_at_location_id character varying(250), - valid_from date, - valid_to date, - dtstart date, - timezone numeric, - until date, - count numeric, - wkst public.schedule_wkst_enum, - freq public.schedule_freq_enum, - "interval" numeric, - byday text, - byweekno text, - bymonthday text, - byyearday text, - description text, - opens_at time without time zone, - closes_at time without time zone, - schedule_link text, - attending_type text, - notes text -); - - -ALTER TABLE public.schedule OWNER TO postgres; - --- --- Name: COLUMN schedule.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.id IS 'The identifier for the schedule. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN schedule.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.service_id IS 'The identifier of the service for which this is the regular schedule'; - - --- --- Name: COLUMN schedule.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.location_id IS 'The identifier of the location for which this is the regular schedule'; - - --- --- Name: COLUMN schedule.service_at_location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.service_at_location_id IS 'The identifier of the ‘service at location’ table entry, when this schedule is specific to a service in a particular location.'; - - --- --- Name: COLUMN schedule.valid_from; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.valid_from IS 'The date from which the schedule information is valid. It must be in the ISO 8601 format of YYYY-MM-DD,'; - - --- --- Name: COLUMN schedule.valid_to; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.valid_to IS 'The last date on which the schedule information is valid. It must be in the ISO 8601 format of YYYY-MM-DD.'; - - --- --- Name: COLUMN schedule.dtstart; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.dtstart IS 'iCal - The date of the first event is the schedule. Necessary when using the ‘interval’ feature, optional otherwise.'; - - --- --- Name: COLUMN schedule.timezone; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.timezone IS 'The timezone that all dates are expressed as, expressed as a UTC offset. Dates are assumed to be UTC otherwise.'; - - --- --- Name: COLUMN schedule.until; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.until IS 'iCal - The date of the last occurrence of the recurring event.'; - - --- --- Name: COLUMN schedule.count; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.count IS 'iCal - The number of times that the event occurs. Use this instead of ‘until’, if appropriate.'; - - --- --- Name: COLUMN schedule.wkst; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.wkst IS 'iCal - The two-letter code for the day on which the week starts: `MO`, `TU`, `WE`, `TH`, `FR`, `FR`, `SA`, `SU`'; - - --- --- Name: COLUMN schedule.freq; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.freq IS 'iCal - How often the frequency repeats. Values can be `WEEKLY` or `MONTHLY`'; - - --- --- Name: COLUMN schedule."interval"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule."interval" IS 'iCal - How often the frequency repeats. For example, and Interval of 2 for a WEEKLY Frequency would represent fortnightly.'; - - --- --- Name: COLUMN schedule.byday; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.byday IS 'iCal - Comma separated days of the week. Where freq is MONTHLY each part can be preceded by a positive or negative integer to represent which occurrence in a month; e.g. 2MO is the second Monday in a month. -1FR is the last Friday'; - - --- --- Name: COLUMN schedule.byweekno; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.byweekno IS 'iCal - Comma separated numeric weeks of the year, where freq is WEEKLY. Can be negative to represent weeks before the end of the year; e.g. -5 is the 5th to last week in a year.'; - - --- --- Name: COLUMN schedule.bymonthday; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.bymonthday IS 'iCal - Comma separated numeric days of the month, where frequency is MONTHLY. Can be negative to represent days before the end of the month; e.g. -5 is the 5th to last day in a month.'; - - --- --- Name: COLUMN schedule.byyearday; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.byyearday IS 'iCal - Comma separated numeric days of the month, where frequency is YEARLY. Can be negative to represent days before the end of the year; e.g. -1 is the last day in a year.'; - - --- --- Name: COLUMN schedule.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.description IS 'A free text description of the availability of the service.'; - - --- --- Name: COLUMN schedule.opens_at; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.opens_at IS 'The time when a service or location opens. This should use HH:MM format and should include timezone information, either adding the suffix ‘Z’ when the date is in UTC, or including an offset from UTC (e.g. 09:00-05:00 for 9am EST.)'; - - --- --- Name: COLUMN schedule.closes_at; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.closes_at IS 'The time when a service or location closes. This should use HH:MM format and should include timezone information, either adding the suffix ‘Z’ when the date is in UTC, or including an offset from UTC (e.g. 09:00-05:00 for 9am EST.).'; - - --- --- Name: COLUMN schedule.schedule_link; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.schedule_link IS 'URL of a link for the schedule which may show each individual session and may provide a booking facility.'; - - --- --- Name: COLUMN schedule.attending_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.attending_type IS 'A free text description of how to attend this service.'; - - --- --- Name: COLUMN schedule.notes; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.schedule.notes IS 'Free text notes on the schedule.'; - - --- --- Name: service; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.service ( - id character varying(250) NOT NULL, - organization_id character varying(250) NOT NULL, - program_id character varying(250), - name text NOT NULL, - alternate_name text, - description text, - url text, - email text, - status public.service_status_enum NOT NULL, - interpretation_services text, - application_process text, - fees_description text, - wait_time text, - fees text, - accreditations text, - eligibility_description text, - minimum_age numeric, - maximum_age numeric, - assured_date date, - assurer_email text, - licenses text, - alert text, - last_modified timestamp without time zone -); - - -ALTER TABLE public.service OWNER TO postgres; - --- --- Name: COLUMN service.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.id IS 'The identifier for the service. Each service must have a unique identifier.'; - - --- --- Name: COLUMN service.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.organization_id IS 'The identifier of the organization that provides this service.'; - - --- --- Name: COLUMN service.program_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.program_id IS 'The identifier of the program this service is delivered under.'; - - --- --- Name: COLUMN service.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.name IS 'The official or public name of the service.'; - - --- --- Name: COLUMN service.alternate_name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.alternate_name IS 'An (optional) alternative name for this service.'; - - --- --- Name: COLUMN service.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.description IS 'A free text description of the service.'; - - --- --- Name: COLUMN service.url; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.url IS 'URL of the service'; - - --- --- Name: COLUMN service.email; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.email IS 'An email address which can be used to contact the service provider.'; - - --- --- Name: COLUMN service.status; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.status IS 'The current status of the service which can be active, inactive, defunct, or temporarily closed.'; - - --- --- Name: COLUMN service.interpretation_services; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.interpretation_services IS 'A free text description of any interpretation services available for accessing this service.'; - - --- --- Name: COLUMN service.application_process; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.application_process IS 'A free text description of the steps needed to access this service.'; - - --- --- Name: COLUMN service.fees_description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.fees_description IS 'A free text description of any charges for service users to access this service.'; - - --- --- Name: COLUMN service.wait_time; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.wait_time IS 'DEPRECATED: The time a client may expect to wait before receiving a service.'; - - --- --- Name: COLUMN service.fees; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.fees IS 'DEPRECATED: Details of any charges for service users to access this service.'; - - --- --- Name: COLUMN service.accreditations; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.accreditations IS 'A free text description of any accreditations. Accreditation is the formal evaluation of an organization or program against best practice standards set by an accrediting organization.'; - - --- --- Name: COLUMN service.eligibility_description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.eligibility_description IS 'A free text description of the type of person for whom this service is intended.'; - - --- --- Name: COLUMN service.minimum_age; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.minimum_age IS 'The minimum age of a person required to meet this eligibility requirement.'; - - --- --- Name: COLUMN service.maximum_age; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.maximum_age IS 'The maximum age of a person required to meet this eligibility requirement.'; - - --- --- Name: COLUMN service.assured_date; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.assured_date IS 'The date that the information about the service was last checked.'; - - --- --- Name: COLUMN service.assurer_email; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.assurer_email IS 'The contact e-mail address for the person or organization which last assured the service.'; - - --- --- Name: COLUMN service.licenses; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.licenses IS 'DEPRECATED: An organization may have a license issued by a government entity to operate legally. A list of any such licenses can be provided here.'; - - --- --- Name: COLUMN service.alert; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.alert IS 'A description of any short term alerts concerning the service.'; - - --- --- Name: COLUMN service.last_modified; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service.last_modified IS 'The datetime when the service, or any related information about the service, has changed. Should have millisecond accuracy.'; - - --- --- Name: service_area; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.service_area ( - id character varying(250) NOT NULL, - service_id character varying(250), - service_at_location_id character varying(250), - name text, - description text, - extent text, - extent_type text, - uri text -); - - -ALTER TABLE public.service_area OWNER TO postgres; - --- --- Name: COLUMN service_area.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.id IS 'The identifier for the service area. Each service area must have a unique identifier.'; - - --- --- Name: COLUMN service_area.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.service_id IS 'The identifier of the service for which this entry describes the service area'; - - --- --- Name: COLUMN service_area.service_at_location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.service_at_location_id IS 'The identifier of the service at location object linked to this object.'; - - --- --- Name: COLUMN service_area.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.name IS 'A free text geographic area where a service is available.'; - - --- --- Name: COLUMN service_area.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.description IS 'A more detailed free text description of this service area. Used to provide any additional information that cannot be communicated using the structured area and geometry fields.'; - - --- --- Name: COLUMN service_area.extent; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.extent IS 'A definition of the polygon defining the area.'; - - --- --- Name: COLUMN service_area.extent_type; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.extent_type IS 'The format of the extent field populated from an enum of "geojson", "topojson", "kml",and (for legacy systems or early state during transformation) "text".'; - - --- --- Name: COLUMN service_area.uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_area.uri IS 'A URI which acts as a persistent identifier to identify an area.'; - - --- --- Name: service_at_location; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.service_at_location ( - id character varying(250) NOT NULL, - service_id character varying(250) NOT NULL, - location_id character varying(250) NOT NULL, - description text -); - - -ALTER TABLE public.service_at_location OWNER TO postgres; - --- --- Name: COLUMN service_at_location.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_at_location.id IS 'The identifier of the service at location entry. Each entry must have a unique identifier.'; - - --- --- Name: COLUMN service_at_location.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_at_location.service_id IS 'The identifier of the service at a given location.'; - - --- --- Name: COLUMN service_at_location.location_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_at_location.location_id IS 'The identifier of the location where this service operates.'; - - --- --- Name: COLUMN service_at_location.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_at_location.description IS 'A free text description of the service at this specific location.'; - - --- --- Name: service_capacity; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.service_capacity ( - id character varying(250) NOT NULL, - service_id character varying(250) NOT NULL, - unit_id character varying(250) NOT NULL, - available numeric NOT NULL, - maximum numeric, - description text, - updated timestamp without time zone NOT NULL -); - - -ALTER TABLE public.service_capacity OWNER TO postgres; - --- --- Name: COLUMN service_capacity.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.id IS 'The identifier for the service_capacity object. Each service_capacity must have a unique identifier.'; - - --- --- Name: COLUMN service_capacity.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.service_id IS 'The identifier for the Service object associated with this service capacity object. Only required in the tabular representation.'; - - --- --- Name: COLUMN service_capacity.unit_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.unit_id IS 'The identifier for the unit object.'; - - --- --- Name: COLUMN service_capacity.available; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.available IS 'The number of units available as of the last update.'; - - --- --- Name: COLUMN service_capacity.maximum; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.maximum IS 'The maximum number of units that can be available for this service, if applicable'; - - --- --- Name: COLUMN service_capacity.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.description IS 'A Human-Friendly description of this service capacity e.g. “Beds available for people experiencing homelessness”'; - - --- --- Name: COLUMN service_capacity.updated; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.service_capacity.updated IS 'The datetime when this service_capacit y object was last updated or changed. Should have millisecond accuracy. '; - - --- --- Name: taxonomy; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.taxonomy ( - id character varying(250) NOT NULL, - name text NOT NULL, - description text NOT NULL, - uri text, - version text -); - - -ALTER TABLE public.taxonomy OWNER TO postgres; - --- --- Name: COLUMN taxonomy.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy.id IS 'The identifier of the taxonomy. Each entry must have a unique identifier'; - - --- --- Name: COLUMN taxonomy.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy.name IS 'The name of the taxonomy from which terms are sourced.'; - - --- --- Name: COLUMN taxonomy.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy.description IS 'A free text description of the taxonomy.'; - - --- --- Name: COLUMN taxonomy.uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy.uri IS 'The URI of the taxonomy.'; - - --- --- Name: COLUMN taxonomy.version; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy.version IS 'The version of the taxonomy.'; - - --- --- Name: taxonomy_term; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.taxonomy_term ( - id character varying(250) NOT NULL, - code text, - name text NOT NULL, - description text NOT NULL, - parent_id text, - taxonomy text, - language text, - taxonomy_id character varying(250), - term_uri text -); - - -ALTER TABLE public.taxonomy_term OWNER TO postgres; - --- --- Name: COLUMN taxonomy_term.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.id IS 'The identifier for this taxonomy term. Each taxonomy term must have a unique identifier, within the scope of the dataset.'; - - --- --- Name: COLUMN taxonomy_term.code; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.code IS 'The term identfier as used in the taxonomy. This and the taxonomy_id combined define the term.'; - - --- --- Name: COLUMN taxonomy_term.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.name IS 'The taxonomy term itself.'; - - --- --- Name: COLUMN taxonomy_term.description; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.description IS 'A free text description of the term.'; - - --- --- Name: COLUMN taxonomy_term.parent_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.parent_id IS 'If this is a child term in a hierarchical taxonomy, give the identifier of the parent category. For top-level categories, this is not required.'; - - --- --- Name: COLUMN taxonomy_term.taxonomy; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.taxonomy IS 'If this is an established taxonomy, a free text description of which taxonomy is in use. If possible, provide a URI.'; - - --- --- Name: COLUMN taxonomy_term.language; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.language IS 'An ISO 639-1, ISO 639-2, or ISO 639-3 [language code](http://www.loc.gov/standards/iso639-2/php/code_list.php) to represent the language of the term. The three-letter codes from ISO 639-2 and ISO 639-3 provide greater accuracy when describing variants of languages, which may be relevant to particular communities.'; - - --- --- Name: COLUMN taxonomy_term.taxonomy_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.taxonomy_id IS 'The identifier of the taxonomy containing the term.'; - - --- --- Name: COLUMN taxonomy_term.term_uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.taxonomy_term.term_uri IS 'URI of the term.'; - - --- --- Name: unit; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.unit ( - id character varying(250) NOT NULL, - name text NOT NULL, - scheme text, - identifier text, - uri text -); - - -ALTER TABLE public.unit OWNER TO postgres; - --- --- Name: COLUMN unit.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.unit.id IS 'The identifier for the unit object. Each unit must have a unique identifier.'; - - --- --- Name: COLUMN unit.name; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.unit.name IS 'The human-readable name for this unit e.g. “Bed” or “Hours”'; - - --- --- Name: COLUMN unit.scheme; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.unit.scheme IS 'The scheme which formalizes the unit, if applicable e.g. “SI” for Standard International Units such as Kilogram, Litre, etc.'; - - --- --- Name: COLUMN unit.identifier; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.unit.identifier IS 'The identifier of the unit taken from the scheme if applicable e.g. `kgm` for Kilogram.'; - - --- --- Name: COLUMN unit.uri; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.unit.uri IS 'The URI to the definition of the unit, if applicable'; - - --- --- Name: url; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.url ( - id character varying(250) NOT NULL, - label text, - url text NOT NULL, - organization_id character varying(250), - service_id character varying(250) -); - - -ALTER TABLE public.url OWNER TO postgres; - --- --- Name: COLUMN url.id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.url.id IS 'The identifier for the URL object. Each URL must have a unique identifier.'; - - --- --- Name: COLUMN url.label; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.url.label IS 'The human-readable label for this url e.g. “Twitter” or “Website”.'; - - --- --- Name: COLUMN url.url; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.url.url IS 'The URL for this URL object. This must be formatted as a valid URI.'; - - --- --- Name: COLUMN url.organization_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.url.organization_id IS 'The identifier for the organization associated with this URL object'; - - --- --- Name: COLUMN url.service_id; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON COLUMN public.url.service_id IS 'The identifier for the service associated with this URL object'; - - --- --- Name: accessibility accessibility_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.accessibility - ADD CONSTRAINT accessibility_pkey PRIMARY KEY (id); - - --- --- Name: address address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.address - ADD CONSTRAINT address_pkey PRIMARY KEY (id); - - --- --- Name: attribute attribute_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.attribute - ADD CONSTRAINT attribute_pkey PRIMARY KEY (id); - - --- --- Name: contact contact_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.contact - ADD CONSTRAINT contact_pkey PRIMARY KEY (id); - - --- --- Name: cost_option cost_option_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.cost_option - ADD CONSTRAINT cost_option_pkey PRIMARY KEY (id); - - --- --- Name: funding funding_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.funding - ADD CONSTRAINT funding_pkey PRIMARY KEY (id); - - --- --- Name: language language_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.language - ADD CONSTRAINT language_pkey PRIMARY KEY (id); - - --- --- Name: location location_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.location - ADD CONSTRAINT location_pkey PRIMARY KEY (id); - - --- --- Name: meta_table_description meta_table_description_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.meta_table_description - ADD CONSTRAINT meta_table_description_pkey PRIMARY KEY (id); - - --- --- Name: metadata metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.metadata - ADD CONSTRAINT metadata_pkey PRIMARY KEY (id); - - --- --- Name: organization_identifier organization_identifier_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.organization_identifier - ADD CONSTRAINT organization_identifier_pkey PRIMARY KEY (id); - - --- --- Name: organization organization_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.organization - ADD CONSTRAINT organization_pkey PRIMARY KEY (id); - - --- --- Name: phone phone_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_pkey PRIMARY KEY (id); - - --- --- Name: program program_organization_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.program - ADD CONSTRAINT program_organization_id_key UNIQUE (organization_id); - - --- --- Name: program program_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.program - ADD CONSTRAINT program_pkey PRIMARY KEY (id); - - --- --- Name: required_document required_document_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.required_document - ADD CONSTRAINT required_document_pkey PRIMARY KEY (id); - - --- --- Name: schedule schedule_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.schedule - ADD CONSTRAINT schedule_pkey PRIMARY KEY (id); - - --- --- Name: service_area service_area_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_area - ADD CONSTRAINT service_area_pkey PRIMARY KEY (id); - - --- --- Name: service_at_location service_at_location_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_at_location - ADD CONSTRAINT service_at_location_pkey PRIMARY KEY (id); - - --- --- Name: service_capacity service_capacity_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_capacity - ADD CONSTRAINT service_capacity_pkey PRIMARY KEY (id); - - --- --- Name: service service_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service - ADD CONSTRAINT service_pkey PRIMARY KEY (id); - - --- --- Name: taxonomy taxonomy_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.taxonomy - ADD CONSTRAINT taxonomy_pkey PRIMARY KEY (id); - - --- --- Name: taxonomy_term taxonomy_term_code_key; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.taxonomy_term - ADD CONSTRAINT taxonomy_term_code_key UNIQUE (code); - - --- --- Name: taxonomy_term taxonomy_term_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.taxonomy_term - ADD CONSTRAINT taxonomy_term_pkey PRIMARY KEY (id); - - --- --- Name: unit unit_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.unit - ADD CONSTRAINT unit_pkey PRIMARY KEY (id); - - --- --- Name: url url_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.url - ADD CONSTRAINT url_pkey PRIMARY KEY (id); - - --- --- Name: accessibility accessibility_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.accessibility - ADD CONSTRAINT accessibility_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: address address_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.address - ADD CONSTRAINT address_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: attribute attribute_taxonomy_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.attribute - ADD CONSTRAINT attribute_taxonomy_term_id_fkey FOREIGN KEY (taxonomy_term_id) REFERENCES public.taxonomy_term(id); - - --- --- Name: contact contact_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.contact - ADD CONSTRAINT contact_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: contact contact_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.contact - ADD CONSTRAINT contact_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: contact contact_service_at_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.contact - ADD CONSTRAINT contact_service_at_location_id_fkey FOREIGN KEY (service_at_location_id) REFERENCES public.service_at_location(id); - - --- --- Name: contact contact_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.contact - ADD CONSTRAINT contact_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: cost_option cost_option_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.cost_option - ADD CONSTRAINT cost_option_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: funding funding_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.funding - ADD CONSTRAINT funding_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: funding funding_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.funding - ADD CONSTRAINT funding_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: language language_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.language - ADD CONSTRAINT language_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: language language_phone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.language - ADD CONSTRAINT language_phone_id_fkey FOREIGN KEY (phone_id) REFERENCES public.phone(id); - - --- --- Name: language language_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.language - ADD CONSTRAINT language_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: location location_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.location - ADD CONSTRAINT location_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: organization_identifier organization_identifier_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.organization_identifier - ADD CONSTRAINT organization_identifier_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: phone phone_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES public.contact(id); - - --- --- Name: phone phone_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: phone phone_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: phone phone_service_at_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_service_at_location_id_fkey FOREIGN KEY (service_at_location_id) REFERENCES public.service_at_location(id); - - --- --- Name: phone phone_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.phone - ADD CONSTRAINT phone_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: program program_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.program - ADD CONSTRAINT program_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: required_document required_document_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.required_document - ADD CONSTRAINT required_document_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: schedule schedule_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.schedule - ADD CONSTRAINT schedule_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: schedule schedule_service_at_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.schedule - ADD CONSTRAINT schedule_service_at_location_id_fkey FOREIGN KEY (service_at_location_id) REFERENCES public.service_at_location(id); - - --- --- Name: schedule schedule_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.schedule - ADD CONSTRAINT schedule_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: service_area service_area_service_at_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_area - ADD CONSTRAINT service_area_service_at_location_id_fkey FOREIGN KEY (service_at_location_id) REFERENCES public.service_at_location(id); - - --- --- Name: service_area service_area_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_area - ADD CONSTRAINT service_area_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: service_at_location service_at_location_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_at_location - ADD CONSTRAINT service_at_location_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.location(id); - - --- --- Name: service_at_location service_at_location_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_at_location - ADD CONSTRAINT service_at_location_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: service_capacity service_capacity_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_capacity - ADD CONSTRAINT service_capacity_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- Name: service_capacity service_capacity_unit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service_capacity - ADD CONSTRAINT service_capacity_unit_id_fkey FOREIGN KEY (unit_id) REFERENCES public.unit(id); - - --- --- Name: service service_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service - ADD CONSTRAINT service_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: service service_program_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.service - ADD CONSTRAINT service_program_id_fkey FOREIGN KEY (program_id) REFERENCES public.program(id); - - --- --- Name: taxonomy_term taxonomy_term_taxonomy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.taxonomy_term - ADD CONSTRAINT taxonomy_term_taxonomy_id_fkey FOREIGN KEY (taxonomy_id) REFERENCES public.taxonomy(id); - - --- --- Name: url url_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.url - ADD CONSTRAINT url_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organization(id); - - --- --- Name: url url_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.url - ADD CONSTRAINT url_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id); - - --- --- PostgreSQL database dump complete --- - -\unrestrict YN7tVkxQMepU09IbFJeeuZLuqBxv1hbK7hOiMQNQe3FuYb9VIciZWSe7ROol6aW - diff --git a/docs/extras/openapi30.json b/docs/extras/openapi30.json index ca40083f..8c360711 100644 --- a/docs/extras/openapi30.json +++ b/docs/extras/openapi30.json @@ -131,7 +131,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service.json" } } } @@ -191,7 +191,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_list.json" } } }, @@ -257,7 +257,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_list.json" } } }, @@ -298,7 +298,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } } @@ -338,7 +338,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } }, @@ -384,7 +384,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } }, @@ -425,7 +425,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } } @@ -486,7 +486,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } }, @@ -553,7 +553,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } }, @@ -599,7 +599,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization.json" } } } @@ -652,7 +652,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization_list.json" } } }, @@ -711,7 +711,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization_list.json" } } }, @@ -752,7 +752,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location.json" } } } @@ -814,7 +814,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location_list.json" } } }, @@ -882,7 +882,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location_list.json" } } }, diff --git a/docs/hsds/changelog.md b/docs/hsds/changelog.md index 0e37621a..36723f4f 100644 --- a/docs/hsds/changelog.md +++ b/docs/hsds/changelog.md @@ -3,6 +3,13 @@ Changelog This page provides the list of changes that have been made to the HSDS schema. +## [v3.2.2](https://github.com/openreferral/specification/releases/tag/v3.2.2) + +* Fixed a big where the `openapi.json` file was referring to schemas from the HSDS 3.0 version + +### Bugfixes + + ## [v3.2.1](https://github.com/openreferral/specification/releases/tag/v3.2.1) ### Bugfixes diff --git a/python/openreferral/utils.py b/python/openreferral/utils.py deleted file mode 100644 index 8c8302cb..00000000 --- a/python/openreferral/utils.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -import json -import csv -import shutil - - -def build_blank_datapackage_for_database_schemas(datapackage_json_file_path, output_dir_path, id_fields_max_length=250): - - # Read datapackage.json - with open(datapackage_json_file_path) as fp: - datapackage = json.load(fp) - - # Edit datapackage.json - # All ID's and foreign keys need a limit set, or some database engines can't use them in primary keys - for resource in datapackage['resources']: - fk_names = [i['fields'] for i in resource['schema'].get('foreignKeys',[])] - for field in resource['schema']['fields']: - if field['name'] == resource['schema']['primaryKey'] or field['name'] in fk_names: - if 'constraints' not in field: - field['constraints'] = {} - field['constraints']['maxLength'] = id_fields_max_length - - # Write datapackage.json - with open(os.path.join(output_dir_path, "datapackage.json"), "w") as fp: - json.dump(datapackage, fp, indent=4) - - # Create blank data files for every table - for table in datapackage.get('resources'): - with open(os.path.join(output_dir_path, table['path']), 'w', newline='') as fp: - writer = csv.writer(fp) - writer.writerows([[i['name'] for i in table['schema']['fields']]]) diff --git a/requirements.txt b/requirements.txt index f35bbc1b..f69fa4db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,9 @@ alabaster==0.7.13 arrow==1.2.3 # via isoduration attrs==22.2.0 - # via jsonschema + # via + # jsonschema + # referencing babel==2.12.1 # via # sphinx @@ -18,7 +20,7 @@ certifi==2023.7.22 # via requests charset-normalizer==3.1.0 # via requests -check-jsonschema==0.22.0 +check-jsonschema==0.30.0 # via -r requirements.in click==8.1.3 # via @@ -47,7 +49,7 @@ fqdn==1.5.1 # via jsonschema hsds-schema-tools @ git+https://github.com/openreferral/hsds_schema_tools # via -r requirements.in -idna==3.4 +idna==3.7 # via # jsonschema # requests @@ -74,12 +76,14 @@ jsonref==1.1.0 # via # compiletojsonschema # sphinxcontrib-opendataservices-jsonschema -jsonschema[format]==4.17.3 +jsonschema[format]==4.23.0 # via # -r requirements.in # check-jsonschema # compiletojsonschema # sphinxcontrib-openapi +jsonschema-specifications==2024.10.1 + # via jsonschema markdown-it-py==2.2.0 # via # mdit-py-plugins @@ -99,7 +103,7 @@ myst-parser==0.17.2 # sphinxcontrib-opendataservices-jsonschema numpy==1.24.2 # via pandas -orjson==3.8.7 +orjson==3.9.15 # via flatterer packaging==23.0 # via sphinx @@ -113,8 +117,6 @@ pygments==2.15.0 # sphinx-mdinclude pygraphviz==1.10 # via erd-from-json-table-schema -pyrsistent==0.19.3 - # via jsonschema python-dateutil==2.8.2 # via # arrow @@ -126,7 +128,11 @@ pyyaml==6.0 # myst-parser # sphinxcontrib-openapi requests==2.32.4 +referencing==0.35.1 # via + # jsonschema + # jsonschema-specifications +regress==2024.11.1 # check-jsonschema # hsds-schema-tools # sphinx @@ -134,7 +140,11 @@ rfc3339-validator==0.1.4 # via jsonschema rfc3987==1.3.8 # via jsonschema -ruamel-yaml==0.17.21 +rpds-py==0.21.0 + # via + # jsonschema + # referencing +ruamel-yaml==0.18.6 # via check-jsonschema ruamel-yaml-clib==0.2.12 # via ruamel-yaml @@ -189,6 +199,8 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx +tomli==2.2.1 + # via check-jsonschema transifex-client==0.12.5 # via -r requirements.in typing-extensions==4.5.0 diff --git a/requirements_build_database.in b/requirements_build_database.in deleted file mode 100644 index eca14b96..00000000 --- a/requirements_build_database.in +++ /dev/null @@ -1,3 +0,0 @@ -frictionless[sql] -mysqlclient -psycopg2 diff --git a/schema/openapi.json b/schema/openapi.json index a21a846b..52d61d7f 100644 --- a/schema/openapi.json +++ b/schema/openapi.json @@ -138,7 +138,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service.json" } } } @@ -198,7 +198,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_list.json" } } }, @@ -264,7 +264,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_list.json" } } }, @@ -305,7 +305,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } } @@ -345,7 +345,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } }, @@ -391,7 +391,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy.json" } } }, @@ -432,7 +432,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } } @@ -493,7 +493,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } }, @@ -560,7 +560,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/taxonomy_term.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/taxonomy_term.json" } } }, @@ -606,7 +606,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization.json" } } } @@ -659,7 +659,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization_list.json" } } }, @@ -718,7 +718,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/organization_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/organization_list.json" } } }, @@ -759,7 +759,7 @@ "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location.json" } } } @@ -821,7 +821,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location_list.json" } } }, @@ -889,7 +889,7 @@ "contents": { "type": "array", "items": { - "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.0/schema/compiled/service_at_location_list.json" + "$ref": "https://raw.githubusercontent.com/openreferral/specification/3.2/schema/compiled/service_at_location_list.json" } } },