2019-04-17 19:29:39 +03:00
|
|
|
# Setup
|
|
|
|
setup:
|
|
|
|
type: bulk
|
|
|
|
args:
|
|
|
|
# tables
|
|
|
|
- type: run_sql
|
|
|
|
args:
|
|
|
|
sql: |
|
|
|
|
create table author(
|
2019-07-22 15:47:13 +03:00
|
|
|
id serial primary key,
|
2019-04-17 19:29:39 +03:00
|
|
|
name text unique
|
|
|
|
);
|
|
|
|
create table article(
|
|
|
|
id serial primary key,
|
|
|
|
title text not null,
|
|
|
|
content text,
|
|
|
|
author_id integer not null references author(id)
|
|
|
|
);
|
|
|
|
- type: track_table
|
|
|
|
args:
|
|
|
|
schema: public
|
|
|
|
name: author
|
|
|
|
- type: track_table
|
|
|
|
args:
|
|
|
|
schema: public
|
|
|
|
name: article
|
2019-07-22 15:47:13 +03:00
|
|
|
|
2019-04-17 19:29:39 +03:00
|
|
|
#Object relationship
|
|
|
|
- type: create_object_relationship
|
|
|
|
args:
|
|
|
|
table: article
|
|
|
|
name: author
|
|
|
|
using:
|
|
|
|
foreign_key_constraint_on: author_id
|
2019-07-22 15:47:13 +03:00
|
|
|
|
2019-04-17 19:29:39 +03:00
|
|
|
#Array relationship
|
|
|
|
- type: create_array_relationship
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
name: articles
|
|
|
|
using:
|
|
|
|
foreign_key_constraint_on:
|
|
|
|
table: article
|
|
|
|
column: author_id
|
|
|
|
|
|
|
|
#SQL to cause inconsistentancy
|
|
|
|
sql: drop table article;
|
|
|
|
# Inconsistent objects to be returned
|
|
|
|
inconsistent_objects:
|
2019-12-16 20:10:02 +03:00
|
|
|
- definition:
|
|
|
|
schema: public
|
|
|
|
name: article
|
2021-03-05 13:52:40 +03:00
|
|
|
reason: 'no such table/view exists in source: "article"'
|
2019-11-20 21:21:30 +03:00
|
|
|
type: table
|
2019-04-17 19:29:39 +03:00
|
|
|
- definition:
|
|
|
|
using:
|
|
|
|
foreign_key_constraint_on:
|
|
|
|
column: author_id
|
2019-12-14 09:47:38 +03:00
|
|
|
table:
|
|
|
|
schema: public
|
|
|
|
name: article
|
2019-04-17 19:29:39 +03:00
|
|
|
name: articles
|
2020-12-28 15:56:00 +03:00
|
|
|
source: default
|
2019-07-22 15:47:13 +03:00
|
|
|
comment:
|
2019-12-16 20:10:02 +03:00
|
|
|
table:
|
|
|
|
schema: public
|
|
|
|
name: author
|
2019-11-20 21:21:30 +03:00
|
|
|
reason: >-
|
2019-12-09 07:18:53 +03:00
|
|
|
in table "author": in relationship "articles": table "article" does not exist
|
2019-04-17 19:29:39 +03:00
|
|
|
type: array_relation
|
|
|
|
|
2019-07-22 15:47:13 +03:00
|
|
|
# Teardown
|
2019-04-17 19:29:39 +03:00
|
|
|
teardown:
|
|
|
|
type: bulk
|
|
|
|
args:
|
|
|
|
- type: run_sql
|
|
|
|
args:
|
|
|
|
sql: |
|
|
|
|
drop table author
|