graphql-engine/server/tests-py/queries/v1/set_table_configuration/setup.yaml
Swann Moreau 5bc0355bdd [server] coalesce multiple run_sql calls in tests (#270)
GitOrigin-RevId: abd7303aaf8e7a8739fd10574249aec450082ef8
2021-01-06 16:07:22 +00:00

54 lines
1.0 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
CREATE TABLE author (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER
);
INSERT INTO author (name, age) VALUES
('Clarke', 23),
('Bellamy', NULL);
CREATE TABLE article (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
content TEXT,
author_id INTEGER NOT NULL REFERENCES author(id)
);
INSERT INTO article (title, content, author_id) VALUES
('Article 1 title', 'Article 1 content', 1),
('Article 2 title', 'Article 2 content', 2);
- type: track_table
version: 2
args:
table: author
configuration:
custom_root_fields:
select: Authors
custom_column_names:
id: AuthorId
- type: track_table
version: 2
args:
table: article
configuration: {}
- type: create_array_relationship
args:
name: articles
table: author
using:
foreign_key_constraint_on:
table: article
column: author_id