graphql-engine/server/testcases/create_array_relationship.json
2018-06-28 00:32:00 +05:30

120 lines
2.4 KiB
JSON

{
"description": "alter column type test",
"depends": [],
"items": [
{
"name": "create table",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "create_table",
"body": {
"primary_key": [
"id"
],
"name": "b",
"columns": [
{
"type": "serial",
"name": "id"
},
{
"type": "integer",
"name": "c"
}
]
}
}
},
{
"name": "create table",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "create_table",
"body": {
"primary_key": [
"id"
],
"name": "a",
"columns": [
{
"type": "serial",
"name": "id"
},
{
"type": "integer",
"name": "b",
"references": {
"column": "id",
"table": "b"
}
}
]
}
}
},
{
"name": "create arr rel",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "create_array_relationship",
"body": {
"name": "a_rel",
"table": "b",
"using": {
"table": "a",
"column": "b"
}
}
}
},
{
"name": "create arr rel",
"url": "/api/1/query",
"role": "admin",
"status_code": 400,
"method": "POST",
"user_id": "1",
"request": {
"kind": "create_array_relationship",
"body": {
"name": "a_rel",
"table": "b",
"using": {
"table": "a",
"column": "b"
}
}
}
},
{
"name": "add column",
"url": "/api/1/query",
"user_id": "1",
"role": "admin",
"status_code": 400,
"method": "POST",
"request": {
"kind": "add_column",
"body" : {
"table": "b",
"column": {
"name": "a_rel",
"type": "integer"
}
}
}
}
]
}