graphql-engine/server/tests-py/queries/v1/relationships/array_relationship_manual.yaml

83 lines
1.7 KiB
YAML

#Array relationship
- description: Create array relationship using manual method
url: /v1/query
status: 200
response:
message: success
query:
type: create_array_relationship
args:
table: author_view
name: articles
using:
manual_configuration:
remote_table: article
column_mapping:
id: author_id
#Rename relationship
- description: Rename relationship articles to articles_array
url: /v1/query
status: 200
response:
message: success
query:
type: rename_relationship
args:
table: author_view
name: articles
new_name: articles_array
#Rename tables associated with the relationship
- description: Rename the remote table
url: /v1/query
status: 200
query:
type: run_sql
args:
sql: |
ALTER TABLE article RENAME TO articles;
- description: Rename the original table/view
url: /v1/query
status: 200
query:
type: run_sql
args:
sql: |
ALTER TABLE author_view RENAME TO authors_view;
- description: Rename tables back to the original name for the teardown process
url: /v1/query
status: 200
query:
type: run_sql
args:
sql: |
ALTER view authors_view RENAME TO author_view;
- description: Rename tables back to the original name for the teardown process
url: /v1/query
status: 200
query:
type: run_sql
args:
sql: |
ALTER TABLE articles RENAME TO article;
#Drop relationship
- description: Drop object relationship
url: /v1/query
status: 200
response:
message: success
query:
type: drop_relationship
args:
table: author_view
relationship: articles_array