diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 14ae750aa7f2f0c8262895c9b64a2a7f6e094d0f..86368345ad07c5564889724f135e89b0f6022894 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,3 +1,3 @@ -FROM debian:stretch +FROM debian:buster RUN apt-get update && \ - apt-get install curl -y + apt-get install curl mariadb-client make unzip -y diff --git a/.gitignore b/.gitignore index 9423022fa1f012760b2a30f664fa175c89f6cbbd..0b8e594885fcd7ae70e753b3ef144ef9cb46ab66 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .* !/.gitignore !/.gitlab-ci.yml +!libs/*.zip # dumps *.dump.sql +libs/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec4dfb07f0695f14b1bd952f7f3c6da578de0423..076a97f06ab2eb06f01f48b855f4367c9f07408f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,14 +19,16 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. # +services: + - mariadb:10.2 variables: - CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb-mysqlbackend-testenv:latest - # When using dind, it's wise to use the overlayfs driver for - # improved performance. + CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/caosdb-mysqlbackend/testenv:latest + MYSQL_ROOT_PASSWORD: caosdb1234 image: $CI_REGISTRY_IMAGE stages: - setup + - test - deploy # Trigger building of server image and integration tests @@ -41,6 +43,17 @@ trigger_build: -F "variables[TriggerdByHash]=$CI_COMMIT_SHORT_SHA" -F ref=dev https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline +unittests: + tags: [ docker ] + stage: test + script: + - cp config.defaults .config + - echo 'DATABASE_USER_HOST_LIST="%,"' >> .config + - echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config + - echo "MYSQL_HOST=mariadb" >> .config + - ./make_db test-connection + - ./make_db test --fresh + # Build a docker image in which tests for this repository can run build-testenv: tags: [ cached-dind ] @@ -48,10 +61,10 @@ build-testenv: stage: setup script: - cd .docker - - docker login -u indiscale -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY # use here general latest or specific branch latest... - docker pull $CI_REGISTRY_IMAGE || true - - docker build + - docker build --pull --cache-from $CI_REGISTRY_IMAGE -t $CI_REGISTRY_IMAGE . diff --git a/README_SETUP.md b/README_SETUP.md index e409edaa9612340490f8cf8642201a5e1812d867..3352a5385a304f1095c1d78aee58ddef5341a0bd 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -35,3 +35,9 @@ this with caution!!!** If you did not backup your database, **everything will be lost afterwards.** And no, there is *no* additional prompt to ask if you are sure. If you `make drop-...`, you *actually* delete the database. + +## Unit tests + +* We use [MyTAP-1.0](https://hepabolu.github.io/mytap/) for unit tests. +* Tests are in `tests/test_*.sql`. +* Run `make test`. diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md new file mode 100644 index 0000000000000000000000000000000000000000..234ff24f40e9c281bfeb23703864c39369aaea05 --- /dev/null +++ b/RELEASE_GUIDELINES.md @@ -0,0 +1,27 @@ +# Release Guidelines for the CaosDB MySQL Backend + +This document specifies release guidelines in addition to the generel release +guidelines of the CaosDB Project +([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md)) + +## General Prerequisites + +* All tests are passing. +* FEATURES.md is up-to-date and a public API is being declared in that document. +* CHANGELOG.md is up-to-date. +* DEPENDENCIES.md is up-to-date. + +## Steps + +1. Create a release branch from the dev branch. This prevents further changes + to the code base and a never ending release process. Naming: `release-<VERSION>` + +2. Check all general prerequisites. + +4. Merge the release branch into the master branch. + +5. Tag the latest commit of the master branch with `v<VERSION>`. + +6. Delete the release branch. + +7. Merge the master branch back into the dev branch. diff --git a/VERSIONING.md b/VERSIONING.md deleted file mode 100644 index 4322eefcb4cb9e871941c69f24303f709324b1e3..0000000000000000000000000000000000000000 --- a/VERSIONING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Versioning - -Starting with version `TODO: the next version`, the versions of the CaosDB MySQL Back-end must follow the principles of [Semantic Versioning 2.0.0](https://semver.org). In summary: - -> Given a version number MAJOR.MINOR.PATCH, increment the: -> -> 1. MAJOR version when you make incompatible API changes, -> 2. MINOR version when you add functionality in a backwards-compatible manner, and -> 3. PATCH version when you make backwards-compatible bug fixes. -> -> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. - - -## §1 API Changes. - -1. All tables, stored procedures and stored functions which names do not begin with the character `_` belong to the api and are not implementation specific. -2. Specifically, that means for all components of the API: - 1. Changes to the design of existing tables or their colums (name, datatype, etc.) MUST always result in anew MAJOR version. The only exception from this rule are changes to the description of a table or column. - 2. Deleting tables is an incompatible API change and results in a new MAJOR version. - 3. Changes to the stored procedures and functions, which change the signature (i.e the list of parameters) is an incompatible change, and results in a new MAJOR version. - 4. Adding new stored functions, procedures or tables results in a new MINOR version. - 5. Changing just a bit of code inside a stored procedure or function results in a new PATCH version. - -## §2 Other Changes. - -1. Changes to any non-API tables, functions and procedures results in a new PATCH version. diff --git a/backup.sh b/backup.sh deleted file mode 100755 index 5a802f0c5dd5db21a30fe13a53c2860e9fa6ae56..0000000000000000000000000000000000000000 --- a/backup.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# ** header v3.0 -# This file is a part of the CaosDB Project. -# -# Copyright (C) 2018 Research Group Biomedical Physics, -# Max-Planck-Institute for Dynamics and Self-Organization Göttingen -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -# ** end header -# - -#dump a database with all procedures, permissions, structure and data - -BACKUPDIR=./backup #The directory which the dump is to be stored to. Do not change it here. Use the --backupdir=./my/dir/ option! -PRINT_HELP="--backupdir=BACKUPDIR\n\tThe directory which the dump is to be stored to. (Defaults to ./backup)\n" - -. load_settings.sh -. utils.sh - -#create backup dir if not exists -[ -d $BACKUPDIR ] || mkdir $BACKUPDIR - -function backup { - NARG_NAME=$1 - NARG_FILE=$2 - shift 2 - echo $MYSQLDUMP_CMD - # parameters: connection, database, outfile - if [ -e "$NARG_FILE" ]; then - failure "dumpfile already exists." - fi - echo "Dumping database $NARG_NAME to $NARG_FILE ... " - $MYSQLDUMP_CMD $MYSQL_CONNECTION_NO_DB $* --opt --default-character-set=utf8 --routines $NARG_NAME > $NARG_FILE - success -} - -##test dump file exists -#touch dumpfile.tmp -#backup 0 1 2 "dumpfile.tmp" -#rm dumpfile.tmp - -DATE=$(date -u --rfc-3339=ns | sed 's/ /T/g') -BACKUPFILE=${BACKUPDIR}/${DATABASE_NAME}.${DATE}.dump.sql -backup $DATABASE_NAME $BACKUPFILE diff --git a/doc/table_structure.md b/doc/table_structure.md new file mode 100644 index 0000000000000000000000000000000000000000..3ec27dc6da12b223eff5a5e7b1725b1af91e97cc --- /dev/null +++ b/doc/table_structure.md @@ -0,0 +1,163 @@ +This document describes the SQL tables used by CaosDB and how they represent the +internal data structure. + +# Tables # + +## entities ## +All entities (RecordTypes, Records, Properties, ...) have an entry here. The +columns are: +- `id` :: The (unique) ID of this entity. +- `name` :: Name of the entity. +- `description` :: A description of the entity. +- `role` :: The role of the entity (e.g. data type, RecordType, Property, + Record, ...). +- `acl` :: Access control ID. + +## isa ## + +Inheritance as in "A is a B" is stored in this table. The columns: + +- `child` :: The child entity. +- `parent` :: The parent entity. +- `type` :: The inheritance type (either `INHERITANCE` or `SUBTYPING` (what's + "subtyping"?)). + +**TODO** Why is this table empty on the default example? + +## isa_cache ## + +Here, information about nested inheritance is cached (upon creation?). + +- `child` :: The child entity. +- `parent` :: The parent entity. +- `rpath` :: Possible intermediate steps on a path from `child` to `parent`. + See the *Inheritance* section for more details. + +## foo_data ## +Property data is stored here, in tables named after the data type: +- date_data +- datetime_data +- double_data +- integer_data +- text_data +- enum_data +- name_data +- null_data +- reference_data + +These tables share (generally) the same set of columns: +- `domain_id` :: The domain of an item, see the *multipurpose subdomains* + section. For "normal" data, this is 0. +- `entity_id` :: The entity to which this property belongs. In most cases, this + is a "normal" entity like a `Record` or `RecordType`. +- `property_id` :: In most cases, the property to which the value belongs. +- `value` :: The value of the property. +- `status` :: The importance of the property (?). +- `pidx` :: The property index, becomes nonzero when a property occurs more than + once in an entity. + +## data_type ## +The type of properties is stored here. The columns are: +- `domain_id` :: Property identitification, same as for plain data? +- `entity_id` :: Property identitification, same as for plain data? +- `property_id` :: Property identitification, same as for plain data? +- `datatype` :: The data type of the property, a reference to an entity. + +## files ## + +- `file_id` :: ID. +- `path` :: (Relative) path to the file. +- `size` :: Size in bytes. +- `hash` :: Hash of the file contents, as binary. **TODO** Which algorithm? +- `checked_timestamp` :: Timestamp when last checked? + +## TODO ## + +- entity_acl +- groups +- logging +- desc_overrides +- name_overrides +- passwd +- passwords +- permissions +- query_template_def :: User-defined query templates? +- roles :: possible user roles +- rules :: SQL action/verification hooks? +- stats :: benchmarking? +- transaction_log :: benchmarking? +- units_lin_con :: fraction and unit conversion? +- user_info :: Metadata for (local?) user accounts +- user_roles :: User permissions? + +# Inheritance caching # + +The `isa_cache` table does not only store direct inheritances, but also nested +parentships. This is done by adding intermediate inheritance steps in the +`rpath` column: + +- For *direct inheritance*, the `rpath` column contains the child itself. +- For all other *possible paths* between the child and parent, it contains the + entities between, separated by the `>` character. + +## Example ## + +Consider this inheritance structure and the resulting table: + +``` + 0 Read this from top to bottom: "1 is a 0", + / \ "2 is a 0", and so on. + 1 2 + \ / + 3 + | + 4 + | + 5 +``` + +|-------|--------|-------| +| child | parent | rpath | +|-------|--------|-------| +| 1 | 0 | 1 | +| 2 | 0 | 2 | +| 3 | 0 | 1 | +| 3 | 0 | 2 | +| 3 | 1 | 3 | +| 3 | 2 | 3 | +| 4 | 0 | 3>1 | +| 4 | 0 | 3>2 | +| 4 | 1 | 3 | +| 4 | 2 | 3 | +| 4 | 3 | 4 | +| 5 | 0 | 4>3>1 | +| 5 | 0 | 4>3>2 | +| 5 | 1 | 4>3 | +| 5 | 2 | 4>3 | +| 5 | 3 | 4 | +| 5 | 4 | 5 | +|-------|--------|-------| + + +# Multipurpose subdomains # +Multipurpose subdomains are generically used to work with composite +properties. Currently implemented examples are: +- Properties with units (if multiple Properties exist) +- Lists +- Name overrides + +## Example ## +Let's have a look at this *Record* (simplified XML): + +```xml +<R1> + <P1 name="Comment">Hello World</P1> + <P2 name="voltage" unit="V"> + 23 + </P2> + <P3 comment="list of something"> + V1, V2, V3, V4, ... + </P3> +</R1> +``` + diff --git a/libs/mytap-1.0.zip b/libs/mytap-1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..9e04965cd40320bde2e598c585119ffa7f6b1eab Binary files /dev/null and b/libs/mytap-1.0.zip differ diff --git a/make_db b/make_db index 9ce63e9049b9c74f31ef93556093b5fccde221ad..ccf3cd4c3c34fc12e86584613d1bda039c7c7f95 100755 --- a/make_db +++ b/make_db @@ -4,6 +4,8 @@ # This file is a part of the CaosDB Project. # # Copyright (C) 2019 Daniel Hornung, Göttingen +# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> +# Copyright (C) 2020 IndiScale <info@indiscale.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -28,6 +30,79 @@ function fail() { exit 1 } +UNITTEST_DATABASE=${UNITTEST_DATABASE-_caosdb_schema_unit_tests} + +# optional parameter: [--fresh] for installing a fresh data base. Otherwise an existing one would be reused. +function runtests() { + DATABASE_NAME=$UNITTEST_DATABASE + _setup_mytap + + _install_unit_test_database $@ + + _execute_tests || ( echo "[FAILURE]" && exit 1 ) + echo "[PASS]" +} + +function _execute_tests () { + pushd tests + TESTS="./test*.sql" + + rm -f .TEST_RESULTS + for tfile in $TESTS ; do + echo "Running $tfile" + echo "----- $tfile -----" >> .TEST_RESULTS + cat $tfile | $SQL --disable-pager --batch --raw --skip-column-names --unbuffered >> .TEST_RESULTS + done; + + popd + cat tests/.TEST_RESULTS + grep -c -i "failed" tests/.TEST_RESULTS > /dev/null && return 1 + return 0 +} + +# install/reset database for unit tests. +# optional parameter: [--fresh] for installing a fresh data base. Otherwise an existing one would be reused. +function _install_unit_test_database () { + DATABASE_NAME=$UNITTEST_DATABASE + if _db_exists "$DATABASE_NAME"; then + if [[ "$1" == "--fresh" ]] ; then + drop "$DATABASE_NAME" ; + else + return 0; + fi + fi + + sed "s/db_2_0/$DATABASE_NAME/g" "$INSTALL_SQL_FILE" | $SQL + + # crate test user + grant + + # update to latest + cp .config .test_config + echo "DATABASE_NAME=\"$UNITTEST_DATABASE\"" >> .test_config + pushd patches > /dev/null + ./applyPatches.sh --env=../.test_config + popd > /dev/null + rm .test_config +} + +# install test framework MyTAP if not installed +function _setup_mytap() { + if _db_exists "tap" ; then + echo MyTAB framework is already installed [OK] + return 0 + fi + echo -n "Installing MyTAB framework ... " + pushd libs > /dev/null + unzip -u mytap*.zip > /dev/null + pushd mytap*/ > /dev/null + $SQL < mytap.sql > /dev/null || exit 1 + popd > /dev/null + rm -r mytap*/ + popd > /dev/null + echo [DONE] +} + function setup_os() { # - mariadb-client :: For SQL server configuration. PACKAGES="git @@ -66,7 +141,7 @@ function restore_db() { } function test-connection() { - $SQL -e "select 0;" + $SQL -e "select 0;" } # Creates a user and grants it sufficient rights. @@ -90,7 +165,7 @@ function grant() { if [[ "$1" == "--strict" ]] ; then for host in ${DATABASE_USER_HOST_LIST//,/ } ; do CMD="SELECT COUNT(*) FROM mysql.user WHERE user='${DATABASE_USER}' AND host='${host}';" - [[ $(SQL -s -N -e "$CMD") == 0 ]] || { + [[ $($SQL -s -N -e "$CMD") == 0 ]] || { echo "The user '${DATABASE_USER}@${host}' is already in the database." echo "Please use another user or delete it, e.g. with" echo "'mysql -u ${MYSQL_USER} -p -e \"DROP USER ${DATABASE_USER}@${host};\"'" @@ -100,6 +175,7 @@ function grant() { fi for host in ${DATABASE_USER_HOST_LIST//,/ } ; do + echo "Granting admin privileges to '$DATABASE_USER'@'$host'" $SQL <<EOF CREATE USER IF NOT EXISTS '$DATABASE_USER'@'$host' identified by '$DATABASE_USER_PW'; @@ -120,13 +196,15 @@ function drop() { "$MYSQLADMIN_CMD" $MYSQL_CONNECTION -f drop "$DROPDB" } + # Returns 0 or non-zero, depending on whether the database exists already. +# Optional parameter: [DATABASE_NAME], else $DATABASE_NAME is used. function _db_exists() { - $SQL -D "$DATABASE_NAME" -e "show tables;" > /dev/null 2>&1 \ + $SQL -D "${1-${DATABASE_NAME}}" -e "show tables;" > /dev/null 2>&1 \ && return 0 || return 1 } -. .config +source .config || true INSTALL_SQL_FILE="db_2_0.sql" if [ -z $LOGIN_PATH ] ; then @@ -142,6 +220,7 @@ SQL="$MYSQL_CMD $MYSQL_CONNECTION" case $1 in "drop") drop $2 ;; "grant") grant $2 ;; + "test") shift ; runtests $@ ;; "test-connection") test-connection ;; "install_db") install_db ;; "restore_db") restore_db $2 ;; diff --git a/makefile b/makefile index 98d20a6cff558391e344a81c3cac9bea52c741f7..f08e739d464c274f6c23138dc73a8383895d90ca 100644 --- a/makefile +++ b/makefile @@ -55,3 +55,7 @@ _grant: .PHONY: drop-% drop-%: ./make_db drop $(patsubst drop-%,%,$@) + +.PHONY: test +test: + ./make_db test --fresh diff --git a/patches/applyPatches.sh b/patches/applyPatches.sh index 76db457f0c5551351b4da4915002ac452d4eb2a4..bec377c249e18ce0272fb4ce0fed3fde522b65b6 100755 --- a/patches/applyPatches.sh +++ b/patches/applyPatches.sh @@ -5,6 +5,8 @@ # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen +# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> +# Copyright (C) 2020 IndiScale <info@indiscale.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -24,7 +26,6 @@ #apply all available patches. set -e -. ./utils/patch_header.sh PATCHES="./patch*/patch.sh" export UTILSPATH="./utils" @@ -33,5 +34,6 @@ do $p "$@" --patch=$p done +source ./utils/patch_header.sh cd ../ ./update_sql_procedures.sh diff --git a/patches/utils/patch_header.sh b/patches/utils/patch_header.sh index 5456c2a1c38fde3ae917c726fb171a24fb3250f0..d02f9f99d4b97001a83587f9f7f8e907def5aaa9 100644 --- a/patches/utils/patch_header.sh +++ b/patches/utils/patch_header.sh @@ -27,7 +27,7 @@ . ../../utils.sh USAGE="$1 [ --env=ENV_FILE ] [ --patch=PATCH ] [ --backupdir=BACKUPDIR ]\n\n" -CMD_OPTIONS=cat <<EOF +CMD_OPTIONS=$(cat <<EOF options: -h, --help @@ -39,7 +39,10 @@ options: --patch=PATCH *TODO* Please document this option. --backupdir=BACKUPDIR - *TODO* Please document this option. + The directory where backup files are stored to. +--yaml[=True|False] + If given (and the optional value is not False), additional machine-readable + YAML output is emitted. Only implemented for some commands yet. This script basically uses the same environment variables as the server configuration make file. Notable examples are: @@ -52,6 +55,7 @@ configuration make file. Notable examples are: - DATABASE_USER_PW EOF + ) set -e function _print_help() { @@ -81,7 +85,14 @@ while test $# -gt 0; do ;; --backupdir*) BACKUPDIR="${1#--*=}" - echo "Warning: BACKUPDIR is not used currently." + shift + ;; + --yaml*) + if [[ "$1" == "--yaml" ]] ; then + YAML="True" + else + YAML="${1#--*=}" + fi shift ;; *) @@ -93,7 +104,6 @@ while test $# -gt 0; do done - if [ -n "$PATCH" ]; then echo -ne "applying patch $PATCH to $DATABASE_NAME ... " fi diff --git a/tests/test_autotap.sql b/tests/test_autotap.sql new file mode 100644 index 0000000000000000000000000000000000000000..f60bb3fca85cceda5956dac74e9fa9948b13a707 --- /dev/null +++ b/tests/test_autotap.sql @@ -0,0 +1,2737 @@ +-- *************************************************************** +-- myTAP Testing Script +-- ==================== +-- Generated: 2020-02-04 +-- This database testing script has been created by the autotap +-- utility. The tests generated are in the TAP format for use with +-- myTAP and are based on the current state of schema objects, +-- with the database assumed to be in a known good state. All tests +-- will pass but that does not guarantee the correctness of the +-- state represented by the tests. +-- +-- After the script is generated, any subsequent DDL changes, +-- whether additions, deletions or modifications, will cause some +-- of the tests to fail. This is intentional. +-- +-- The purpose of the utility is to assist the process of +-- retrofitting testing to existing projects. You should still check +-- that the schema state represents what you intend and you should +-- modify this script by hand to account for all subsequent changes. +-- *************************************************************** + + +-- *************************************************************** +-- SCHEMA _caosdb_schema_unit_tests +-- *************************************************************** + +USE tap; +BEGIN; +CALL tap.no_plan(); +SELECT tap.has_schema('_caosdb_schema_unit_tests',''); + +-- *************************************************************** +-- TABLES +-- *************************************************************** + +SELECT tap.tables_are('_caosdb_schema_unit_tests','`collection_type`,`data_type`,`date_data`,`datetime_data`,`desc_overrides`,`double_data`,`entities`,`entity_acl`,`enum_data`,`files`,`integer_data`,`isa_cache`,`logging`,`name_data`,`name_overrides`,`null_data`,`passwd`,`permissions`,`query_template_def`,`reference_data`,`roles`,`rules`,`stats`,`text_data`,`transaction_log`,`units_lin_con`,`user_info`,`user_roles`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.collection_type +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','collection_type',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','collection_type','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','collection_type','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','collection_type','`domain_id`,`entity_id`,`property_id`,`collection`',''); + +-- COLUMN collection_type.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','collection_type','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','collection_type','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','collection_type','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','collection_type','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','collection_type','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','collection_type','domain_id',NULL,''); + +-- COLUMN collection_type.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','collection_type','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','collection_type','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','collection_type','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','collection_type','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','collection_type','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','collection_type','entity_id',NULL,''); + +-- COLUMN collection_type.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','collection_type','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','collection_type','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','collection_type','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','collection_type','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','collection_type','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','collection_type','property_id',NULL,''); + +-- COLUMN collection_type.collection + +SELECT tap.has_column('_caosdb_schema_unit_tests','collection_type','collection',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','collection_type','collection','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','collection_type','collection','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','collection_type','collection',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','collection_type','collection','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','collection_type','collection','utf8_unicode_ci',''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','collection_type','`domain_id`,`entity_id`,`property_id`',''); + +-- INDEX collection_type.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','collection_type','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','collection_type','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','collection_type','`domain_id`,`entity_id`',''); + +-- INDEX collection_type.entity_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','collection_type','entity_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','collection_type','entity_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','collection_type','`entity_id`',''); + +-- INDEX collection_type.property_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','collection_type','property_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','collection_type','property_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','collection_type','`property_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','collection_type','`collection_type_domain_id_entity`,`collection_type_entity_id_entity`,`collection_type_property_id_entity`',''); + +-- CONSTRAINT collection_type.collection_type_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','collection_type','collection_type_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','collection_type','collection_type_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','collection_type','collection_type_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','collection_type','collection_type_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT collection_type.collection_type_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','collection_type','collection_type_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','collection_type','collection_type_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','collection_type','collection_type_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','collection_type','collection_type_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT collection_type.collection_type_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','collection_type','collection_type_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','collection_type','collection_type_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','collection_type','collection_type_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','collection_type','collection_type_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.data_type +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','data_type',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','data_type','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','data_type','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','data_type','`domain_id`,`entity_id`,`property_id`,`datatype`',''); + +-- COLUMN data_type.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','data_type','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','data_type','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','data_type','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','data_type','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','data_type','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','data_type','domain_id',NULL,''); + +-- COLUMN data_type.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','data_type','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','data_type','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','data_type','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','data_type','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','data_type','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','data_type','entity_id',NULL,''); + +-- COLUMN data_type.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','data_type','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','data_type','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','data_type','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','data_type','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','data_type','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','data_type','property_id',NULL,''); + +-- COLUMN data_type.datatype + +SELECT tap.has_column('_caosdb_schema_unit_tests','data_type','datatype',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','data_type','datatype','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','data_type','datatype','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','data_type','datatype',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','data_type','datatype',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','data_type','datatype',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','data_type','`name_ov_dom_ent_idx`',''); + +-- INDEX data_type.name_ov_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','data_type','name_ov_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','data_type','name_ov_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','data_type','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','data_type','`datatype_ukey`,`datatype_forkey_dom`,`datatype_forkey_ent`,`datatype_forkey_pro`,`datatype_forkey_type`',''); + +-- CONSTRAINT data_type.datatype_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','data_type','datatype_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','data_type','datatype_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','data_type','datatype_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','data_type','datatype_forkey_dom','RESTRICT',''); + +-- CONSTRAINT data_type.datatype_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','data_type','datatype_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','data_type','datatype_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','data_type','datatype_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','data_type','datatype_forkey_ent','RESTRICT',''); + +-- CONSTRAINT data_type.datatype_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','data_type','datatype_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','data_type','datatype_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','data_type','datatype_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','data_type','datatype_forkey_pro','RESTRICT',''); + +-- CONSTRAINT data_type.datatype_forkey_type + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','data_type','datatype_forkey_type',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','data_type','datatype_forkey_type','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','data_type','datatype_forkey_type','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','data_type','datatype_forkey_type','RESTRICT',''); + +-- CONSTRAINT data_type.datatype_ukey + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','data_type','datatype_ukey',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','data_type','datatype_ukey','UNIQUE',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.date_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','date_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','date_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','date_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','date_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`',''); + +-- COLUMN date_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','domain_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','domain_id',NULL,''); + +-- COLUMN date_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','entity_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','entity_id',NULL,''); + +-- COLUMN date_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','property_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','property_id',NULL,''); + +-- COLUMN date_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','value','int(11)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','value',NULL,''); + +-- COLUMN date_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','status','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','status','utf8_unicode_ci',''); + +-- COLUMN date_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','date_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','date_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','date_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','date_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','date_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','date_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','date_data','`date_data_dom_ent_idx`',''); + +-- INDEX date_data.date_data_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','date_data','date_data_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','date_data','date_data_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','date_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','date_data','`date_ov_forkey_dom`,`date_ov_forkey_ent`,`date_ov_forkey_pro`',''); + +-- CONSTRAINT date_data.date_ov_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','date_data','date_ov_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','date_data','date_ov_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','date_data','date_ov_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','date_data','date_ov_forkey_dom','RESTRICT',''); + +-- CONSTRAINT date_data.date_ov_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','date_data','date_ov_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','date_data','date_ov_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','date_data','date_ov_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','date_data','date_ov_forkey_ent','RESTRICT',''); + +-- CONSTRAINT date_data.date_ov_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','date_data','date_ov_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','date_data','date_ov_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','date_data','date_ov_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','date_data','date_ov_forkey_pro','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.datetime_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','datetime_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','datetime_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','datetime_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','datetime_data','`domain_id`,`entity_id`,`property_id`,`status`,`pidx`,`value_ns`,`value`',''); + +-- COLUMN datetime_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','domain_id',NULL,''); + +-- COLUMN datetime_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','entity_id',NULL,''); + +-- COLUMN datetime_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','property_id',NULL,''); + +-- COLUMN datetime_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','status','utf8_unicode_ci',''); + +-- COLUMN datetime_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','pidx',NULL,''); + +-- COLUMN datetime_data.value_ns + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','value_ns',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','value_ns','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','value_ns','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','value_ns','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','value_ns',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','value_ns',NULL,''); + +-- COLUMN datetime_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','datetime_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','datetime_data','value','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','datetime_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','datetime_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','datetime_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','datetime_data','value',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','datetime_data','`domain_id`',''); + +-- INDEX datetime_data.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','datetime_data','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','datetime_data','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','datetime_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','datetime_data','`dat_domain_id_entity`,`dat_entity_id_entity`,`dat_property_id_entity`',''); + +-- CONSTRAINT datetime_data.dat_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','datetime_data','dat_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','datetime_data','dat_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','datetime_data','dat_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','datetime_data','dat_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT datetime_data.dat_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','datetime_data','dat_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','datetime_data','dat_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','datetime_data','dat_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','datetime_data','dat_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT datetime_data.dat_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','datetime_data','dat_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','datetime_data','dat_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','datetime_data','dat_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','datetime_data','dat_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.desc_overrides +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','desc_overrides',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','desc_overrides','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','desc_overrides','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','desc_overrides','`domain_id`,`entity_id`,`property_id`,`description`',''); + +-- COLUMN desc_overrides.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','desc_overrides','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','desc_overrides','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','desc_overrides','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','desc_overrides','domain_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','desc_overrides','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','desc_overrides','domain_id',NULL,''); + +-- COLUMN desc_overrides.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','desc_overrides','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','desc_overrides','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','desc_overrides','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','desc_overrides','entity_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','desc_overrides','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','desc_overrides','entity_id',NULL,''); + +-- COLUMN desc_overrides.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','desc_overrides','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','desc_overrides','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','desc_overrides','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','desc_overrides','property_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','desc_overrides','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','desc_overrides','property_id',NULL,''); + +-- COLUMN desc_overrides.description + +SELECT tap.has_column('_caosdb_schema_unit_tests','desc_overrides','description',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','desc_overrides','description','text',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','desc_overrides','description','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','desc_overrides','description','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','desc_overrides','description','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','desc_overrides','description','utf8_unicode_ci',''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','desc_overrides','`desc_ov_dom_ent_idx`',''); + +-- INDEX desc_overrides.desc_ov_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','desc_overrides','desc_ov_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','desc_overrides','desc_ov_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','desc_overrides','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','desc_overrides','`desc_ov_ukey`,`desc_ov_forkey_dom`,`desc_ov_forkey_ent`,`desc_ov_forkey_pro`',''); + +-- CONSTRAINT desc_overrides.desc_ov_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_dom','RESTRICT',''); + +-- CONSTRAINT desc_overrides.desc_ov_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_ent','RESTRICT',''); + +-- CONSTRAINT desc_overrides.desc_ov_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','desc_overrides','desc_ov_forkey_pro','RESTRICT',''); + +-- CONSTRAINT desc_overrides.desc_ov_ukey + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','desc_overrides','desc_ov_ukey',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','desc_overrides','desc_ov_ukey','UNIQUE',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.double_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','double_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','double_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','double_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','double_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`,`unit_sig`',''); + +-- COLUMN double_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','domain_id',NULL,''); + +-- COLUMN double_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','entity_id',NULL,''); + +-- COLUMN double_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','property_id',NULL,''); + +-- COLUMN double_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','value','double',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','value',NULL,''); + +-- COLUMN double_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','status','utf8_unicode_ci',''); + +-- COLUMN double_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','pidx',NULL,''); + +-- COLUMN double_data.unit_sig + +SELECT tap.has_column('_caosdb_schema_unit_tests','double_data','unit_sig',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','double_data','unit_sig','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','double_data','unit_sig','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','double_data','unit_sig','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','double_data','unit_sig',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','double_data','unit_sig',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','double_data','`domain_id`',''); + +-- INDEX double_data.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','double_data','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','double_data','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','double_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','double_data','`dou_domain_id_entity`,`dou_entity_id_entity`,`dou_property_id_entity`',''); + +-- CONSTRAINT double_data.dou_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','double_data','dou_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','double_data','dou_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','double_data','dou_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','double_data','dou_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT double_data.dou_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','double_data','dou_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','double_data','dou_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','double_data','dou_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','double_data','dou_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT double_data.dou_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','double_data','dou_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','double_data','dou_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','double_data','dou_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','double_data','dou_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.entities +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','entities',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','entities','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','entities','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','entities','`id`,`name`,`description`,`role`,`acl`',''); + +-- COLUMN entities.id + +SELECT tap.has_column('_caosdb_schema_unit_tests','entities','id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entities','id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entities','id','auto_increment',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entities','id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entities','id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entities','id',NULL,''); + +-- COLUMN entities.name + +SELECT tap.has_column('_caosdb_schema_unit_tests','entities','name',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entities','name','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entities','name','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entities','name','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entities','name','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entities','name','utf8_unicode_ci',''); + +-- COLUMN entities.description + +SELECT tap.has_column('_caosdb_schema_unit_tests','entities','description',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entities','description','text',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entities','description','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entities','description','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entities','description','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entities','description','utf8_unicode_ci',''); + +-- COLUMN entities.role + +SELECT tap.has_column('_caosdb_schema_unit_tests','entities','role',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entities','role','enum(\'RECORDTYPE\',\'RECORD\',\'FILE\',\'DOMAIN\',\'PROPERTY\',\'DATATYPE\',\'ROLE\',\'QUERYTEMPLATE\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entities','role','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entities','role',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entities','role','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entities','role','utf8_unicode_ci',''); + +-- COLUMN entities.acl + +SELECT tap.has_column('_caosdb_schema_unit_tests','entities','acl',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entities','acl','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entities','acl','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entities','acl','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entities','acl',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entities','acl',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','entities','`PRIMARY`,`entity_entity_acl`',''); + +-- CONSTRAINT entities.entity_entity_acl + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','entities','entity_entity_acl',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','entities','entity_entity_acl','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','entities','entity_entity_acl','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','entities','entity_entity_acl','RESTRICT',''); + +-- CONSTRAINT entities.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','entities','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','entities','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','entities','`id`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.entity_acl +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','entity_acl',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','entity_acl','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','entity_acl','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','entity_acl','`id`,`acl`',''); + +-- COLUMN entity_acl.id + +SELECT tap.has_column('_caosdb_schema_unit_tests','entity_acl','id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entity_acl','id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entity_acl','id','auto_increment',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entity_acl','id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entity_acl','id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entity_acl','id',NULL,''); + +-- COLUMN entity_acl.acl + +SELECT tap.has_column('_caosdb_schema_unit_tests','entity_acl','acl',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','entity_acl','acl','varbinary(65525)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','entity_acl','acl','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','entity_acl','acl',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entity_acl','acl',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','entity_acl','acl',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','entity_acl','`entity_acl_acl`',''); + +-- INDEX entity_acl.entity_acl_acl + +SELECT tap.has_index('_caosdb_schema_unit_tests','entity_acl','entity_acl_acl',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','entity_acl','entity_acl_acl','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','entity_acl','`acl`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','entity_acl','`PRIMARY`',''); + +-- CONSTRAINT entity_acl.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','entity_acl','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','entity_acl','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','entity_acl','`id`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.enum_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','enum_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','enum_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','enum_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','enum_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`',''); + +-- COLUMN enum_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','domain_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','domain_id',NULL,''); + +-- COLUMN enum_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','entity_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','entity_id',NULL,''); + +-- COLUMN enum_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','property_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','property_id',NULL,''); + +-- COLUMN enum_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','value','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','value',NULL,''); + +-- COLUMN enum_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','status','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','status','utf8_unicode_ci',''); + +-- COLUMN enum_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','enum_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','enum_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','enum_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','enum_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','enum_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','enum_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','enum_data','`enum_ov_dom_ent_idx`',''); + +-- INDEX enum_data.enum_ov_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','enum_data','enum_ov_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','enum_data','enum_ov_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','enum_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','enum_data','`enum_ov_forkey_dom`,`enum_ov_forkey_ent`,`enum_ov_forkey_pro`',''); + +-- CONSTRAINT enum_data.enum_ov_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_dom','RESTRICT',''); + +-- CONSTRAINT enum_data.enum_ov_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_ent','RESTRICT',''); + +-- CONSTRAINT enum_data.enum_ov_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','enum_data','enum_ov_forkey_pro','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.files +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','files',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','files','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','files','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','files','`file_id`,`path`,`size`,`hash`,`checked_timestamp`',''); + +-- COLUMN files.file_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','files','file_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','files','file_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','files','file_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','files','file_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','files','file_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','files','file_id',NULL,''); + +-- COLUMN files.path + +SELECT tap.has_column('_caosdb_schema_unit_tests','files','path',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','files','path','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','files','path','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','files','path',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','files','path','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','files','path','utf8_unicode_ci',''); + +-- COLUMN files.size + +SELECT tap.has_column('_caosdb_schema_unit_tests','files','size',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','files','size','bigint(20) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','files','size','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','files','size',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','files','size',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','files','size',NULL,''); + +-- COLUMN files.hash + +SELECT tap.has_column('_caosdb_schema_unit_tests','files','hash',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','files','hash','binary(64)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','files','hash','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','files','hash','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','files','hash',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','files','hash',NULL,''); + +-- COLUMN files.checked_timestamp + +SELECT tap.has_column('_caosdb_schema_unit_tests','files','checked_timestamp',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','files','checked_timestamp','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','files','checked_timestamp','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','files','checked_timestamp',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','files','checked_timestamp',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','files','checked_timestamp',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','files','`PRIMARY`,`fil_file_id_entity`',''); + +-- CONSTRAINT files.fil_file_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','files','fil_file_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','files','fil_file_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','files','fil_file_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','files','fil_file_id_entity','RESTRICT',''); + +-- CONSTRAINT files.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','files','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','files','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','files','`file_id`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.integer_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','integer_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','integer_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','integer_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','integer_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`,`unit_sig`',''); + +-- COLUMN integer_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','domain_id',NULL,''); + +-- COLUMN integer_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','entity_id',NULL,''); + +-- COLUMN integer_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','property_id',NULL,''); + +-- COLUMN integer_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','value','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','value',NULL,''); + +-- COLUMN integer_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','status','utf8_unicode_ci',''); + +-- COLUMN integer_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','pidx',NULL,''); + +-- COLUMN integer_data.unit_sig + +SELECT tap.has_column('_caosdb_schema_unit_tests','integer_data','unit_sig',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','integer_data','unit_sig','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','integer_data','unit_sig','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','integer_data','unit_sig','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','integer_data','unit_sig',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','integer_data','unit_sig',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','integer_data','`domain_id`',''); + +-- INDEX integer_data.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','integer_data','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','integer_data','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','integer_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','integer_data','`int_domain_id_entity`,`int_entity_id_entity`,`int_property_id_entity`',''); + +-- CONSTRAINT integer_data.int_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','integer_data','int_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','integer_data','int_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','integer_data','int_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','integer_data','int_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT integer_data.int_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','integer_data','int_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','integer_data','int_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','integer_data','int_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','integer_data','int_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT integer_data.int_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','integer_data','int_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','integer_data','int_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','integer_data','int_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','integer_data','int_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.isa_cache +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','isa_cache',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','isa_cache','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','isa_cache','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','isa_cache','`child`,`parent`,`rpath`',''); + +-- COLUMN isa_cache.child + +SELECT tap.has_column('_caosdb_schema_unit_tests','isa_cache','child',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','isa_cache','child','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','isa_cache','child','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','isa_cache','child',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','isa_cache','child',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','isa_cache','child',NULL,''); + +-- COLUMN isa_cache.parent + +SELECT tap.has_column('_caosdb_schema_unit_tests','isa_cache','parent',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','isa_cache','parent','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','isa_cache','parent','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','isa_cache','parent',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','isa_cache','parent',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','isa_cache','parent',NULL,''); + +-- COLUMN isa_cache.rpath + +SELECT tap.has_column('_caosdb_schema_unit_tests','isa_cache','rpath',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','isa_cache','rpath','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','isa_cache','rpath','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','isa_cache','rpath',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','isa_cache','rpath','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','isa_cache','rpath','utf8_unicode_ci',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','isa_cache','`PRIMARY`,`isa_cache_child_entity`,`isa_cache_parent_entity`',''); + +-- CONSTRAINT isa_cache.isa_cache_child_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','isa_cache','isa_cache_child_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','isa_cache','isa_cache_child_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','isa_cache','isa_cache_child_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','isa_cache','isa_cache_child_entity','RESTRICT',''); + +-- CONSTRAINT isa_cache.isa_cache_parent_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','isa_cache','isa_cache_parent_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','isa_cache','isa_cache_parent_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','isa_cache','isa_cache_parent_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','isa_cache','isa_cache_parent_entity','RESTRICT',''); + +-- CONSTRAINT isa_cache.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','isa_cache','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','isa_cache','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','isa_cache','`child`,`parent`,`rpath`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.logging +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','logging',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','logging','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','logging','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','logging','`level`,`logger`,`message`,`millis`,`logRecord`',''); + +-- COLUMN logging.level + +SELECT tap.has_column('_caosdb_schema_unit_tests','logging','level',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','logging','level','int(11)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','logging','level','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','logging','level',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','logging','level',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','logging','level',NULL,''); + +-- COLUMN logging.logger + +SELECT tap.has_column('_caosdb_schema_unit_tests','logging','logger',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','logging','logger','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','logging','logger','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','logging','logger',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','logging','logger','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','logging','logger','utf8_unicode_ci',''); + +-- COLUMN logging.message + +SELECT tap.has_column('_caosdb_schema_unit_tests','logging','message',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','logging','message','mediumtext',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','logging','message','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','logging','message',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','logging','message','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','logging','message','utf8_unicode_ci',''); + +-- COLUMN logging.millis + +SELECT tap.has_column('_caosdb_schema_unit_tests','logging','millis',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','logging','millis','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','logging','millis','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','logging','millis',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','logging','millis',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','logging','millis',NULL,''); + +-- COLUMN logging.logRecord + +SELECT tap.has_column('_caosdb_schema_unit_tests','logging','logRecord',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','logging','logRecord','blob',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','logging','logRecord','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','logging','logRecord',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','logging','logRecord',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','logging','logRecord',NULL,''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.name_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','name_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','name_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','name_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','name_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`',''); + +-- COLUMN name_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','domain_id',NULL,''); + +-- COLUMN name_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','entity_id',NULL,''); + +-- COLUMN name_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','property_id',NULL,''); + +-- COLUMN name_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','value','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','value','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','value','utf8_unicode_ci',''); + +-- COLUMN name_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','status','utf8_unicode_ci',''); + +-- COLUMN name_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','name_data','`domain_id`,`entity_id`,`property_id`,`value`',''); + +-- INDEX name_data.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','name_data','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','name_data','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','name_data','`domain_id`,`entity_id`',''); + +-- INDEX name_data.entity_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','name_data','entity_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','name_data','entity_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','name_data','`entity_id`',''); + +-- INDEX name_data.property_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','name_data','property_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','name_data','property_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','name_data','`property_id`',''); + +-- INDEX name_data.value + +SELECT tap.has_index('_caosdb_schema_unit_tests','name_data','value',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','name_data','value','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','name_data','`value`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','name_data','`name_data_domain_id_entity`,`name_data_entity_id_entity`,`name_data_property_id_entity`',''); + +-- CONSTRAINT name_data.name_data_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_data','name_data_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_data','name_data_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_data','name_data_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_data','name_data_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT name_data.name_data_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_data','name_data_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_data','name_data_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_data','name_data_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_data','name_data_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT name_data.name_data_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_data','name_data_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_data','name_data_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_data','name_data_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_data','name_data_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.name_overrides +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','name_overrides',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','name_overrides','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','name_overrides','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','name_overrides','`domain_id`,`entity_id`,`property_id`,`name`',''); + +-- COLUMN name_overrides.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_overrides','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_overrides','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_overrides','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_overrides','domain_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_overrides','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_overrides','domain_id',NULL,''); + +-- COLUMN name_overrides.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_overrides','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_overrides','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_overrides','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_overrides','entity_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_overrides','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_overrides','entity_id',NULL,''); + +-- COLUMN name_overrides.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_overrides','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_overrides','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_overrides','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_overrides','property_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_overrides','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_overrides','property_id',NULL,''); + +-- COLUMN name_overrides.name + +SELECT tap.has_column('_caosdb_schema_unit_tests','name_overrides','name',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','name_overrides','name','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','name_overrides','name','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','name_overrides','name','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','name_overrides','name','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','name_overrides','name','utf8_unicode_ci',''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','name_overrides','`name_ov_dom_ent_idx`',''); + +-- INDEX name_overrides.name_ov_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','name_overrides','name_ov_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','name_overrides','name_ov_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','name_overrides','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','name_overrides','`name_ov_ukey`,`name_ov_forkey_dom`,`name_ov_forkey_ent`,`name_ov_forkey_pro`',''); + +-- CONSTRAINT name_overrides.name_ov_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_dom','RESTRICT',''); + +-- CONSTRAINT name_overrides.name_ov_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_ent','RESTRICT',''); + +-- CONSTRAINT name_overrides.name_ov_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','name_overrides','name_ov_forkey_pro','RESTRICT',''); + +-- CONSTRAINT name_overrides.name_ov_ukey + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','name_overrides','name_ov_ukey',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','name_overrides','name_ov_ukey','UNIQUE',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.null_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','null_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','null_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','null_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','null_data','`domain_id`,`entity_id`,`property_id`,`status`,`pidx`',''); + +-- COLUMN null_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','null_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','null_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','null_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','null_data','domain_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','null_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','null_data','domain_id',NULL,''); + +-- COLUMN null_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','null_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','null_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','null_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','null_data','entity_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','null_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','null_data','entity_id',NULL,''); + +-- COLUMN null_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','null_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','null_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','null_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','null_data','property_id','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','null_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','null_data','property_id',NULL,''); + +-- COLUMN null_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','null_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','null_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','null_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','null_data','status','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','null_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','null_data','status','utf8_unicode_ci',''); + +-- COLUMN null_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','null_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','null_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','null_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','null_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','null_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','null_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','null_data','`null_data_dom_ent_idx`',''); + +-- INDEX null_data.null_data_dom_ent_idx + +SELECT tap.has_index('_caosdb_schema_unit_tests','null_data','null_data_dom_ent_idx',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','null_data','null_data_dom_ent_idx','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','null_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','null_data','`null_forkey_dom`,`null_forkey_ent`,`null_forkey_pro`',''); + +-- CONSTRAINT null_data.null_forkey_dom + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','null_data','null_forkey_dom',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','null_data','null_forkey_dom','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','null_data','null_forkey_dom','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','null_data','null_forkey_dom','RESTRICT',''); + +-- CONSTRAINT null_data.null_forkey_ent + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','null_data','null_forkey_ent',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','null_data','null_forkey_ent','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','null_data','null_forkey_ent','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','null_data','null_forkey_ent','RESTRICT',''); + +-- CONSTRAINT null_data.null_forkey_pro + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','null_data','null_forkey_pro',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','null_data','null_forkey_pro','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','null_data','null_forkey_pro','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','null_data','null_forkey_pro','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.passwd +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','passwd',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','passwd','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','passwd','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','passwd','`principal`,`hash`,`alg`,`it`,`salt`',''); + +-- COLUMN passwd.principal + +SELECT tap.has_column('_caosdb_schema_unit_tests','passwd','principal',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','passwd','principal','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','passwd','principal','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','passwd','principal',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','passwd','principal',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','passwd','principal',NULL,''); + +-- COLUMN passwd.hash + +SELECT tap.has_column('_caosdb_schema_unit_tests','passwd','hash',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','passwd','hash','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','passwd','hash','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','passwd','hash',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','passwd','hash',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','passwd','hash',NULL,''); + +-- COLUMN passwd.alg + +SELECT tap.has_column('_caosdb_schema_unit_tests','passwd','alg',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','passwd','alg','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','passwd','alg','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','passwd','alg','\'SHA-512\'',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','passwd','alg','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','passwd','alg','utf8_unicode_ci',''); + +-- COLUMN passwd.it + +SELECT tap.has_column('_caosdb_schema_unit_tests','passwd','it',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','passwd','it','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','passwd','it','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','passwd','it',5000,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','passwd','it',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','passwd','it',NULL,''); + +-- COLUMN passwd.salt + +SELECT tap.has_column('_caosdb_schema_unit_tests','passwd','salt',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','passwd','salt','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','passwd','salt','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','passwd','salt',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','passwd','salt',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','passwd','salt',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','passwd','`PRIMARY`',''); + +-- CONSTRAINT passwd.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','passwd','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','passwd','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','passwd','`principal`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.permissions +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','permissions',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','permissions','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','permissions','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','permissions','`role`,`permissions`',''); + +-- COLUMN permissions.role + +SELECT tap.has_column('_caosdb_schema_unit_tests','permissions','role',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','permissions','role','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','permissions','role','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','permissions','role',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','permissions','role',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','permissions','role',NULL,''); + +-- COLUMN permissions.permissions + +SELECT tap.has_column('_caosdb_schema_unit_tests','permissions','permissions',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','permissions','permissions','mediumtext',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','permissions','permissions','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','permissions','permissions',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','permissions','permissions','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','permissions','permissions','utf8_unicode_ci',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','permissions','`PRIMARY`,`perm_name_roles`',''); + +-- CONSTRAINT permissions.perm_name_roles + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','permissions','perm_name_roles',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','permissions','perm_name_roles','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','permissions','perm_name_roles','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','permissions','perm_name_roles','RESTRICT',''); + +-- CONSTRAINT permissions.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','permissions','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','permissions','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','permissions','`role`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.query_template_def +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','query_template_def',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','query_template_def','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','query_template_def','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','query_template_def','`id`,`definition`',''); + +-- COLUMN query_template_def.id + +SELECT tap.has_column('_caosdb_schema_unit_tests','query_template_def','id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','query_template_def','id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','query_template_def','id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','query_template_def','id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','query_template_def','id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','query_template_def','id',NULL,''); + +-- COLUMN query_template_def.definition + +SELECT tap.has_column('_caosdb_schema_unit_tests','query_template_def','definition',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','query_template_def','definition','mediumtext',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','query_template_def','definition','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','query_template_def','definition',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','query_template_def','definition','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','query_template_def','definition','utf8_unicode_ci',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','query_template_def','`PRIMARY`,`query_template_def_ibfk_1`',''); + +-- CONSTRAINT query_template_def.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','query_template_def','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','query_template_def','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','query_template_def','`id`',''); + +-- CONSTRAINT query_template_def.query_template_def_ibfk_1 + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','query_template_def','query_template_def_ibfk_1',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','query_template_def','query_template_def_ibfk_1','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','query_template_def','query_template_def_ibfk_1','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','query_template_def','query_template_def_ibfk_1','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.reference_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','reference_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','reference_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','reference_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','reference_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`',''); + +-- COLUMN reference_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','domain_id',NULL,''); + +-- COLUMN reference_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','entity_id',NULL,''); + +-- COLUMN reference_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','property_id',NULL,''); + +-- COLUMN reference_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','value','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','value',NULL,''); + +-- COLUMN reference_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','status','utf8_unicode_ci',''); + +-- COLUMN reference_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','reference_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','reference_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','reference_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','reference_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','reference_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','reference_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','reference_data','`entity_id`',''); + +-- INDEX reference_data.entity_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','reference_data','entity_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','reference_data','entity_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','reference_data','`entity_id`,`property_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','reference_data','`ref_domain_id_entity`,`ref_entity_id_entity`,`ref_property_id_entity`,`ref_value_entity`',''); + +-- CONSTRAINT reference_data.ref_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','reference_data','ref_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','reference_data','ref_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','reference_data','ref_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','reference_data','ref_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT reference_data.ref_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','reference_data','ref_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','reference_data','ref_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','reference_data','ref_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','reference_data','ref_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT reference_data.ref_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','reference_data','ref_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','reference_data','ref_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','reference_data','ref_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','reference_data','ref_property_id_entity','RESTRICT',''); + +-- CONSTRAINT reference_data.ref_value_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','reference_data','ref_value_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','reference_data','ref_value_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','reference_data','ref_value_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','reference_data','ref_value_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.roles +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','roles',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','roles','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','roles','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','roles','`name`,`description`',''); + +-- COLUMN roles.name + +SELECT tap.has_column('_caosdb_schema_unit_tests','roles','name',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','roles','name','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','roles','name','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','roles','name',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','roles','name',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','roles','name',NULL,''); + +-- COLUMN roles.description + +SELECT tap.has_column('_caosdb_schema_unit_tests','roles','description',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','roles','description','mediumtext',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','roles','description','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','roles','description','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','roles','description','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','roles','description','utf8_unicode_ci',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','roles','`PRIMARY`',''); + +-- CONSTRAINT roles.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','roles','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','roles','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','roles','`name`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.rules +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','rules',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','rules','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','rules','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','rules','`domain_id`,`entity_id`,`transaction`,`criterion`,`modus`',''); + +-- COLUMN rules.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','rules','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,''); + +-- COLUMN rules.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','rules','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,''); + +-- COLUMN rules.transaction + +SELECT tap.has_column('_caosdb_schema_unit_tests','rules','transaction',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','transaction','enum(\'INSERT\',\'RETRIEVE\',\'UPDATE\',\'DELETE\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','transaction','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','transaction',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','transaction','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','transaction','utf8_unicode_ci',''); + +-- COLUMN rules.criterion + +SELECT tap.has_column('_caosdb_schema_unit_tests','rules','criterion',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','criterion','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','criterion','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','criterion',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','criterion','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','criterion','utf8_unicode_ci',''); + +-- COLUMN rules.modus + +SELECT tap.has_column('_caosdb_schema_unit_tests','rules','modus',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','modus','enum(\'MUST\',\'SHOULD\',\'SHOULDNT\',\'MUSTNOT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','modus','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','modus',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','modus','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','modus','utf8_unicode_ci',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','rules','`rule_domain_id_entity`,`rule_entity_id_entity`',''); + +-- CONSTRAINT rules.rule_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','rules','rule_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT rules.rule_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','rules','rule_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.stats +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','stats',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','stats','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','stats','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','stats','`name`,`value`',''); + +-- COLUMN stats.name + +SELECT tap.has_column('_caosdb_schema_unit_tests','stats','name',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','stats','name','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','stats','name','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','stats','name',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','stats','name','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','stats','name','utf8_unicode_ci',''); + +-- COLUMN stats.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','stats','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','stats','value','blob',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','stats','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','stats','value','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','stats','value',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','stats','value',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','stats','`PRIMARY`',''); + +-- CONSTRAINT stats.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','stats','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','stats','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','stats','`name`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.text_data +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','text_data',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','text_data','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','text_data','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','text_data','`domain_id`,`entity_id`,`property_id`,`value`,`status`,`pidx`',''); + +-- COLUMN text_data.domain_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','domain_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','domain_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','domain_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','domain_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','domain_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','domain_id',NULL,''); + +-- COLUMN text_data.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','entity_id',NULL,''); + +-- COLUMN text_data.property_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','property_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','property_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','property_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','property_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','property_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','property_id',NULL,''); + +-- COLUMN text_data.value + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','value',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','value','text',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','value','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','value',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','value','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','value','utf8_unicode_ci',''); + +-- COLUMN text_data.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','status','enum(\'OBLIGATORY\',\'RECOMMENDED\',\'SUGGESTED\',\'FIX\',\'REPLACEMENT\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','status',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','status','utf8_unicode_ci',''); + +-- COLUMN text_data.pidx + +SELECT tap.has_column('_caosdb_schema_unit_tests','text_data','pidx',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','text_data','pidx','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','text_data','pidx','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','text_data','pidx',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','text_data','pidx',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','text_data','pidx',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','text_data','`domain_id`',''); + +-- INDEX text_data.domain_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','text_data','domain_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','text_data','domain_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','text_data','`domain_id`,`entity_id`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','text_data','`str_domain_id_entity`,`str_entity_id_entity`,`str_property_id_entity`',''); + +-- CONSTRAINT text_data.str_domain_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','text_data','str_domain_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','text_data','str_domain_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','text_data','str_domain_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','text_data','str_domain_id_entity','RESTRICT',''); + +-- CONSTRAINT text_data.str_entity_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','text_data','str_entity_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','text_data','str_entity_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','text_data','str_entity_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','text_data','str_entity_id_entity','RESTRICT',''); + +-- CONSTRAINT text_data.str_property_id_entity + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','text_data','str_property_id_entity',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','text_data','str_property_id_entity','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','text_data','str_property_id_entity','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','text_data','str_property_id_entity','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.transaction_log +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','transaction_log',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','transaction_log','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','transaction_log','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','transaction_log','`transaction`,`entity_id`,`username`,`seconds`,`nanos`,`realm`',''); + +-- COLUMN transaction_log.transaction + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','transaction',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','transaction','varchar(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','transaction','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','transaction',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','transaction','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','transaction','utf8_unicode_ci',''); + +-- COLUMN transaction_log.entity_id + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','entity_id',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','entity_id','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','entity_id','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','entity_id',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','entity_id',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','entity_id',NULL,''); + +-- COLUMN transaction_log.username + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','username',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','username','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','username','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','username',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','username',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','username',NULL,''); + +-- COLUMN transaction_log.seconds + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','seconds',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','seconds','bigint(20) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','seconds','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','seconds',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','seconds',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','seconds',NULL,''); + +-- COLUMN transaction_log.nanos + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','nanos',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','nanos','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','nanos','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','nanos',0,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','nanos',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','nanos',NULL,''); + +-- COLUMN transaction_log.realm + +SELECT tap.has_column('_caosdb_schema_unit_tests','transaction_log','realm',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','transaction_log','realm','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','transaction_log','realm','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','transaction_log','realm',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','transaction_log','realm',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','transaction_log','realm',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','transaction_log','`entity_id`',''); + +-- INDEX transaction_log.entity_id + +SELECT tap.has_index('_caosdb_schema_unit_tests','transaction_log','entity_id',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','transaction_log','entity_id','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','transaction_log','`entity_id`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.units_lin_con +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','units_lin_con',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','units_lin_con','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','units_lin_con','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','units_lin_con','`signature_from`,`signature_to`,`a`,`b_dividend`,`b_divisor`,`c`',''); + +-- COLUMN units_lin_con.signature_from + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','signature_from',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','signature_from','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','signature_from','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','signature_from',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','signature_from',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','signature_from',NULL,''); + +-- COLUMN units_lin_con.signature_to + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','signature_to',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','signature_to','bigint(20)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','signature_to','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','signature_to',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','signature_to',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','signature_to',NULL,''); + +-- COLUMN units_lin_con.a + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','a',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','a','decimal(65,30)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','a','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','a',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','a',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','a',NULL,''); + +-- COLUMN units_lin_con.b_dividend + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','b_dividend',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','b_dividend','int(11)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','b_dividend','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','b_dividend',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','b_dividend',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','b_dividend',NULL,''); + +-- COLUMN units_lin_con.b_divisor + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','b_divisor',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','b_divisor','int(11)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','b_divisor','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','b_divisor',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','b_divisor',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','b_divisor',NULL,''); + +-- COLUMN units_lin_con.c + +SELECT tap.has_column('_caosdb_schema_unit_tests','units_lin_con','c',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','units_lin_con','c','decimal(65,30)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','units_lin_con','c','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','units_lin_con','c',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','units_lin_con','c',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','units_lin_con','c',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','units_lin_con','`PRIMARY`',''); + +-- CONSTRAINT units_lin_con.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','units_lin_con','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','units_lin_con','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','units_lin_con','`signature_from`',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.user_info +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','user_info',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','user_info','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','user_info','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','user_info','`realm`,`name`,`email`,`status`,`entity`',''); + +-- COLUMN user_info.realm + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_info','realm',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_info','realm','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_info','realm','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_info','realm',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_info','realm',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_info','realm',NULL,''); + +-- COLUMN user_info.name + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_info','name',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_info','name','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_info','name','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_info','name',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_info','name',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_info','name',NULL,''); + +-- COLUMN user_info.email + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_info','email',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_info','email','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_info','email','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_info','email','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_info','email',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_info','email',NULL,''); + +-- COLUMN user_info.status + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_info','status',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_info','status','enum(\'ACTIVE\',\'INACTIVE\')',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_info','status','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_info','status','\'INACTIVE\'',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_info','status','utf8',''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_info','status','utf8_unicode_ci',''); + +-- COLUMN user_info.entity + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_info','entity',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_info','entity','int(10) unsigned',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_info','entity','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_info','entity','NULL',''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_info','entity',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_info','entity',NULL,''); + +-- INDEXES +SELECT tap.indexes_are('_caosdb_schema_unit_tests','user_info','`subject_entity`',''); + +-- INDEX user_info.subject_entity + +SELECT tap.has_index('_caosdb_schema_unit_tests','user_info','subject_entity',''); +SELECT tap.index_is_type('_caosdb_schema_unit_tests','user_info','subject_entity','BTREE',''); +SELECT tap.is_indexed('_caosdb_schema_unit_tests','user_info','`entity`',''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','user_info','`PRIMARY`,`subjects_ibfk_1`',''); + +-- CONSTRAINT user_info.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','user_info','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','user_info','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','user_info','`realm`,`name`',''); + +-- CONSTRAINT user_info.subjects_ibfk_1 + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','user_info','subjects_ibfk_1',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','user_info','subjects_ibfk_1','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','user_info','subjects_ibfk_1','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','user_info','subjects_ibfk_1','RESTRICT',''); + +-- *************************************************************** +-- TABLE _caosdb_schema_unit_tests.user_roles +-- *************************************************************** + +SELECT tap.has_table('_caosdb_schema_unit_tests','user_roles',''); +SELECT tap.table_collation_is('_caosdb_schema_unit_tests','user_roles','utf8_unicode_ci',''); +SELECT tap.table_engine_is('_caosdb_schema_unit_tests','user_roles','InnoDB',''); + +-- COLUMNS +SELECT tap.columns_are('_caosdb_schema_unit_tests','user_roles','`realm`,`user`,`role`',''); + +-- COLUMN user_roles.realm + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_roles','realm',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_roles','realm','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_roles','realm','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_roles','realm',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_roles','realm',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_roles','realm',NULL,''); + +-- COLUMN user_roles.user + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_roles','user',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_roles','user','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_roles','user','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_roles','user',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_roles','user',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_roles','user',NULL,''); + +-- COLUMN user_roles.role + +SELECT tap.has_column('_caosdb_schema_unit_tests','user_roles','role',''); +SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','user_roles','role','varbinary(255)',''); +SELECT tap.col_extra_is('_caosdb_schema_unit_tests','user_roles','role','',''); +SELECT tap.col_default_is('_caosdb_schema_unit_tests','user_roles','role',NULL,''); +SELECT tap.col_charset_is('_caosdb_schema_unit_tests','user_roles','role',NULL,''); +SELECT tap.col_collation_is('_caosdb_schema_unit_tests','user_roles','role',NULL,''); + +-- CONSTRAINTS +SELECT tap.constraints_are('_caosdb_schema_unit_tests','user_roles','`PRIMARY`,`user_roles_ibfk_1`',''); + +-- CONSTRAINT user_roles.PRIMARY + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','user_roles','PRIMARY',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','user_roles','PRIMARY','PRIMARY KEY',''); +SELECT tap.col_is_pk('_caosdb_schema_unit_tests','user_roles','`realm`,`user`,`role`',''); + +-- CONSTRAINT user_roles.user_roles_ibfk_1 + +SELECT tap.has_constraint('_caosdb_schema_unit_tests','user_roles','user_roles_ibfk_1',''); +SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','user_roles','user_roles_ibfk_1','FOREIGN KEY',''); +SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','user_roles','user_roles_ibfk_1','RESTRICT',''); +SELECT tap.fk_on_update('_caosdb_schema_unit_tests','user_roles','user_roles_ibfk_1','RESTRICT',''); + +-- *************************************************************** +-- FUNCTIONS +-- *************************************************************** + +SELECT tap.routines_are('_caosdb_schema_unit_tests','FUNCTION','`CaosDBVersion`,`convert_unit`,`constructDateTimeWhereClauseForColumn`,`getAggValueWhereClause`,`getDateTimeWhereClause`,`getDoubleWhereClause`,`getDateWhereClause`,`makeStmt`,`standard_unit`',''); + +-- FUNCTION _caosdb_schema_unit_tests.CaosDBVersion + +SELECT tap.has_function('_caosdb_schema_unit_tests','CaosDBVersion',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','CaosDBVersion','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','CaosDBVersion','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','CaosDBVersion','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','CaosDBVersion','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.convert_unit + +SELECT tap.has_function('_caosdb_schema_unit_tests','convert_unit',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','convert_unit','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','convert_unit','decimal',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','convert_unit','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','convert_unit','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.constructDateTimeWhereClauseForColumn + +SELECT tap.has_function('_caosdb_schema_unit_tests','constructDateTimeWhereClauseForColumn',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','constructDateTimeWhereClauseForColumn','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','constructDateTimeWhereClauseForColumn','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','constructDateTimeWhereClauseForColumn','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','constructDateTimeWhereClauseForColumn','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.getAggValueWhereClause + +SELECT tap.has_function('_caosdb_schema_unit_tests','getAggValueWhereClause',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','getAggValueWhereClause','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','getAggValueWhereClause','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','getAggValueWhereClause','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','getAggValueWhereClause','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.getDateTimeWhereClause + +SELECT tap.has_function('_caosdb_schema_unit_tests','getDateTimeWhereClause',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','getDateTimeWhereClause','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','getDateTimeWhereClause','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','getDateTimeWhereClause','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','getDateTimeWhereClause','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.getDoubleWhereClause + +SELECT tap.has_function('_caosdb_schema_unit_tests','getDoubleWhereClause',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','getDoubleWhereClause','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','getDoubleWhereClause','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','getDoubleWhereClause','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','getDoubleWhereClause','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.getDateWhereClause + +SELECT tap.has_function('_caosdb_schema_unit_tests','getDateWhereClause',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','getDateWhereClause','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','getDateWhereClause','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','getDateWhereClause','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','getDateWhereClause','CONTAINS SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.makeStmt + +SELECT tap.has_function('_caosdb_schema_unit_tests','makeStmt',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','makeStmt','NO',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','makeStmt','varchar',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','makeStmt','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','makeStmt','NO SQL',''); + +-- FUNCTION _caosdb_schema_unit_tests.standard_unit + +SELECT tap.has_function('_caosdb_schema_unit_tests','standard_unit',''); +SELECT tap.function_is_deterministic('_caosdb_schema_unit_tests','standard_unit','YES',''); +SELECT tap.function_data_type_is('_caosdb_schema_unit_tests','standard_unit','bigint',''); +SELECT tap.function_security_type_is('_caosdb_schema_unit_tests','standard_unit','DEFINER',''); +SELECT tap.function_sql_data_access_is('_caosdb_schema_unit_tests','standard_unit','CONTAINS SQL',''); + +-- *************************************************************** +-- PROCEDURES +-- *************************************************************** + +SELECT tap.routines_are('_caosdb_schema_unit_tests','PROCEDURE','`applyBackReference`,`applyPOV`,`applyRefPOV`,`applyIDFilter`,`applySAT`,`applyTransactionFilter`,`calcComplementUnion`,`calcDifference`,`calcIntersection`,`calcUnion`,`cleanUpLinCon`,`cleanUpQuery`,`copyTable`,`createTmpTable`,`createTmpTable2`,`deleteEntity`,`deleteEntityProperties`,`deleteIsa`,`deleteLinCon`,`entityACL`,`finishNegationFilter`,`finishSubProperty`,`getChildren`,`getFileIdByPath`,`getRole`,`getRules`,`initAutoIncrement`,`initBackReference`,`getFile`,`initConjunctionFilter`,`initDisjunctionFilter`,`initNegationFilter`,`initPOVRefidsTable`,`initQuery`,`insertEntity`,`getDependentEntities`,`initEmptyTargetSet`,`initEntity`,`insertLinCon`,`insertUser`,`intersectTable`,`initPOVPropertiesTable`,`initSubEntity`,`isSubtype`,`overrideDesc`,`overrideName`,`overrideType`,`raiseWarning`,`registerSubdomain`,`initSubProperty`,`insertEntityProperty`,`registerTempTableName`,`retrieveDatatype`,`retrieveEntityParents`,`retrieveGroup`,`setPassword`,`insertIsa`,`retrieveEntity`,`retrieveEntityProperties`,`showEntityAutoIncr`,`updateLinCon`,`retrieveOverrides`,`updateEntity`',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applyBackReference + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applyBackReference',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applyBackReference','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applyBackReference','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applyBackReference','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applyPOV + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applyPOV',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applyPOV','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applyPOV','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applyPOV','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applyRefPOV + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applyRefPOV',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applyRefPOV','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applyRefPOV','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applyRefPOV','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applyIDFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applyIDFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applyIDFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applyIDFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applyIDFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applySAT + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applySAT',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applySAT','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applySAT','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applySAT','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.applyTransactionFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','applyTransactionFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','applyTransactionFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','applyTransactionFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','applyTransactionFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.calcComplementUnion + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','calcComplementUnion',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','calcComplementUnion','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','calcComplementUnion','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','calcComplementUnion','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.calcDifference + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','calcDifference',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','calcDifference','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','calcDifference','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','calcDifference','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.calcIntersection + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','calcIntersection',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','calcIntersection','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','calcIntersection','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','calcIntersection','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.calcUnion + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','calcUnion',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','calcUnion','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','calcUnion','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','calcUnion','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.cleanUpLinCon + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','cleanUpLinCon',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','cleanUpLinCon','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','cleanUpLinCon','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','cleanUpLinCon','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.cleanUpQuery + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','cleanUpQuery',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','cleanUpQuery','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','cleanUpQuery','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','cleanUpQuery','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.copyTable + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','copyTable',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','copyTable','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','copyTable','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','copyTable','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.createTmpTable + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','createTmpTable',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','createTmpTable','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','createTmpTable','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','createTmpTable','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.createTmpTable2 + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','createTmpTable2',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','createTmpTable2','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','createTmpTable2','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','createTmpTable2','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.deleteEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','deleteEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','deleteEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','deleteEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','deleteEntity','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.deleteEntityProperties + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','deleteEntityProperties',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','deleteEntityProperties','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','deleteEntityProperties','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','deleteEntityProperties','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.deleteIsa + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','deleteIsa',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','deleteIsa','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','deleteIsa','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','deleteIsa','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.deleteLinCon + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','deleteLinCon',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','deleteLinCon','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','deleteLinCon','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','deleteLinCon','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.entityACL + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','entityACL',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','entityACL','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','entityACL','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','entityACL','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.finishNegationFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','finishNegationFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','finishNegationFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','finishNegationFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','finishNegationFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.finishSubProperty + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','finishSubProperty',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','finishSubProperty','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','finishSubProperty','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','finishSubProperty','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getChildren + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getChildren',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getChildren','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getChildren','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getChildren','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getFileIdByPath + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getFileIdByPath',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getFileIdByPath','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getFileIdByPath','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getFileIdByPath','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getRole + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getRole',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getRole','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getRole','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getRole','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getRules + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getRules',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getRules','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getRules','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getRules','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initAutoIncrement + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initAutoIncrement',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initAutoIncrement','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initAutoIncrement','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initAutoIncrement','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initBackReference + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initBackReference',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initBackReference','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initBackReference','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initBackReference','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getFile + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getFile',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getFile','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getFile','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getFile','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initConjunctionFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initConjunctionFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initConjunctionFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initConjunctionFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initConjunctionFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initDisjunctionFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initDisjunctionFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initDisjunctionFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initDisjunctionFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initDisjunctionFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initNegationFilter + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initNegationFilter',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initNegationFilter','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initNegationFilter','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initNegationFilter','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initPOVRefidsTable + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initPOVRefidsTable',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initPOVRefidsTable','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initPOVRefidsTable','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initPOVRefidsTable','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initQuery + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initQuery',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initQuery','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initQuery','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initQuery','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.insertEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertEntity','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.getDependentEntities + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','getDependentEntities',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getDependentEntities','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getDependentEntities','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getDependentEntities','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initEmptyTargetSet + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initEmptyTargetSet',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initEmptyTargetSet','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initEmptyTargetSet','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initEmptyTargetSet','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initEntity','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.insertLinCon + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertLinCon',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertLinCon','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertLinCon','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertLinCon','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.insertUser + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertUser',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertUser','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertUser','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertUser','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.intersectTable + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','intersectTable',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','intersectTable','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','intersectTable','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','intersectTable','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initPOVPropertiesTable + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initPOVPropertiesTable',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initPOVPropertiesTable','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initPOVPropertiesTable','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initPOVPropertiesTable','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initSubEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initSubEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initSubEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initSubEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initSubEntity','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.isSubtype + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','isSubtype',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','isSubtype','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','isSubtype','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','isSubtype','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.overrideDesc + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','overrideDesc',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','overrideDesc','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','overrideDesc','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','overrideDesc','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.overrideName + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','overrideName',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','overrideName','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','overrideName','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','overrideName','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.overrideType + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','overrideType',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','overrideType','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','overrideType','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','overrideType','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.raiseWarning + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','raiseWarning',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','raiseWarning','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','raiseWarning','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','raiseWarning','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.registerSubdomain + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','registerSubdomain',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','registerSubdomain','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','registerSubdomain','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','registerSubdomain','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.initSubProperty + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','initSubProperty',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initSubProperty','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initSubProperty','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initSubProperty','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.insertEntityProperty + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertEntityProperty',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertEntityProperty','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertEntityProperty','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertEntityProperty','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.registerTempTableName + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','registerTempTableName',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','registerTempTableName','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','registerTempTableName','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','registerTempTableName','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveDatatype + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveDatatype',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveDatatype','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveDatatype','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveDatatype','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveEntityParents + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveEntityParents',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveEntityParents','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveEntityParents','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveEntityParents','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveGroup + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveGroup',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveGroup','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveGroup','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveGroup','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.setPassword + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','setPassword',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','setPassword','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','setPassword','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','setPassword','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.insertIsa + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertIsa',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertIsa','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertIsa','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertIsa','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveEntity','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveEntityProperties + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveEntityProperties',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveEntityProperties','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveEntityProperties','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveEntityProperties','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.showEntityAutoIncr + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','showEntityAutoIncr',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','showEntityAutoIncr','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','showEntityAutoIncr','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','showEntityAutoIncr','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.updateLinCon + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','updateLinCon',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','updateLinCon','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','updateLinCon','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','updateLinCon','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.retrieveOverrides + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','retrieveOverrides',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','retrieveOverrides','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','retrieveOverrides','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','retrieveOverrides','CONTAINS SQL',''); + +-- PROCEDURES _caosdb_schema_unit_tests.updateEntity + +SELECT tap.has_procedure('_caosdb_schema_unit_tests','updateEntity',''); +SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','updateEntity','NO',''); +SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','updateEntity','DEFINER',''); +SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','updateEntity','CONTAINS SQL',''); +CALL tap.finish(); +ROLLBACK; diff --git a/utils/backup.sh b/utils/backup.sh new file mode 100755 index 0000000000000000000000000000000000000000..ff671437f42832c8c66ba250f777c4aa8d3f0c88 --- /dev/null +++ b/utils/backup.sh @@ -0,0 +1,139 @@ +#!/bin/bash +# +# ** header v3.0 +# This file is a part of the CaosDB Project. +# +# Copyright (C) 2018 Research Group Biomedical Physics, +# Max-Planck-Institute for Dynamics and Self-Organization Göttingen +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +# ** end header +# + +# Dump a database with all procedures, permissions, structure and data + +# The directory which the dump is to be stored to. Do not change it here. Use +# the --backupdir=./my/dir/ option or an environment variable instead. +BACKUPDIR="${BACKUPDIR:-../backup}" + +# Iff this (environment) variable is "true" as lower-case, then this script also +# outputs a machine readable status report. The variable can also be set by +# giving the `--yaml` command line option. +YAML="${YAML:-false}" + +PRINT_HELP="--backupdir=BACKUPDIR\n\tThe directory which the dump is to be stored to. (Defaults to ./backup,\n\tcan also be set as an environment variable.)\n" + +# YAML string templates ####################################################### + +YAML_FAIL=$(cat << "EOF" +#### YAML #### +error: + code: $error_code + message: $error_message +#### YAML END #### +EOF + ) + +YAML_SUCCESS=$(cat << "EOF" +#### YAML #### +error: + code: 0 + message: Backup successfully created +backup: + location: $file_location + date: $date +#### YAML END #### +EOF + ) + +# Config and command line parameter loading ################################### + +. ../.config + +# load useful stuff - parses the commandline parameters and so on... +. ../patches/utils/patch_header.sh + +function backup() { + NARG_NAME="$1" + NARG_FILE="$2" + + shift 2 + # parameters: connection, database, outfile + if [ -e "$NARG_FILE" ]; then + failure "dumpfile already exists." + fi + echo "Dumping database $NARG_NAME to $NARG_FILE ... " + $CMD_MYSQL_DUMP $MYSQL_CONNECTION_NO_DB $* --opt --default-character-set=utf8 --routines \ + "$NARG_NAME" > "$NARG_FILE" + + if [[ "$YAML" == "true" ]] ; then + yaml_success "$NARG_FILE" "$DATE" + fi + success +} + +# Print a YAML failure message, if YAML is true. +# +# Arguments: +# - $1 Error code, integer > 0 +# - $2 Error message +function yaml_fail() { + err_code="$1" + err_msg="$2" + local yaml="${YAML_FAIL/\$err_code/$err_code}" + yaml="${yaml/\$err_msg/$err_msg}" + echo "$yaml" +} + +# Print a YAML success message, if YAML is true. +# +# Arguments: +# - $1 The file location of the backup file. +# - $2 The current date & time +function yaml_success() { + file_location="$1" + date="$2" + local yaml="${YAML_SUCCESS/\$file_location/$file_location}" + yaml="${yaml/\$date/$date}" + echo "$yaml" +} + +## test if dump file exists +#touch dumpfile.tmp +#backup 0 1 2 "dumpfile.tmp" +#rm dumpfile.tmp + +# Assert backup dir +mkdir -p "$BACKUPDIR" + +DATE=$(date -u --rfc-3339=ns | sed 's/ /T/g') +BACKUPFILE=${BACKUPDIR}/${DATABASE_NAME}.${DATE}.dump.sql + +# echo "date: $date" >&2 +# echo "file_location: $file_location" >&2 + +#YAML_SUCCESS=$(cat <<"EOF" +read -r -d '' YAML_SUCCESS <<"EOF" || true +#### YAML #### +error: + code: 0 + message: Backup successfully created +backup: + location: $file_location + date: $date +#### YAML END #### +EOF + +backup $DATABASE_NAME $BACKUPFILE