graphql-engine/server/tests-py/queries/inconsistent_objects/setup.yaml
Samir Talwar 43779ff0c1 server/tests-py: Fix test_inconsistent_meta.py for split databases.
This test did not work when splitting the metadata and source backends. Fixed mostly by running the relevant SQL using `source_backend.engine`, but I also took the time to clean it up a little, and broke up _test.yaml_ into 3 files.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6957
GitOrigin-RevId: bbca60a8906caba2d0cffd834b3b8595fca058fd
2022-11-23 14:14:01 +00:00

43 lines
818 B
YAML

type: bulk
args:
# tables
- type: run_sql
args:
sql: |
create table author(
id serial primary key,
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
#Object relationship
- type: create_object_relationship
args:
table: article
name: author
using:
foreign_key_constraint_on: author_id
#Array relationship
- type: create_array_relationship
args:
table: author
name: articles
using:
foreign_key_constraint_on:
table: article
column: author_id