graphql-engine/server/tests-py/queries/v1/set_table_configuration/setup.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.0 KiB
YAML
Raw Normal View History

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