mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
83 lines
1.7 KiB
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
|