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

206 lines
5.1 KiB
JSON

{
"description": "drop column test",
"depends": [
"permission.json"
],
"items": [
{
"name": "drop col",
"url": "/api/1/query",
"role": "admin",
"status_code": 400,
"method": "POST",
"user_id": "1",
"response": {"path":"$","error":"can not delete due to the following dependent objects - [(\"article\",foreign_key_constraint,\"article_author_id_fkey\"),(\"article\",relationship,\"author\"),(\"author\",relationship,\"articles\"),(\"article\",permission,\"user (insert)\"),(\"article\",permission,\"user (select)\"),(\"article\",permission,\"user (update)\"),(\"article\",permission,\"user (delete)\")]"},
"request": {
"kind": "drop_column",
"body": {
"table": "article",
"column": "author_id",
"cascade": false
}
}
},
{
"name": "drop perm",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_insert_permission",
"body": {
"table": "article",
"role": "user"
}
}
},
{
"name": "drop perm",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_select_permission",
"body": {
"table": "article",
"role": "user"
}
}
},
{
"name": "drop perm",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_update_permission",
"body": {
"table": "article",
"role": "user"
}
}
},
{
"name": "drop perm",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_delete_permission",
"body": {
"table": "article",
"role": "user"
}
}
},
{
"name": "drop col",
"url": "/api/1/query",
"role": "admin",
"status_code": 400,
"method": "POST",
"user_id": "1",
"response": {
"path": "$",
"error": "can not delete due to the following dependent objects - [(\"article\",foreign_key_constraint,\"article_author_id_fkey\"),(\"article\",relationship,\"author\"),(\"author\",relationship,\"articles\")]"
},
"request": {
"kind": "drop_column",
"body": {
"table": "article",
"column": "author_id",
"cascade": false
}
}
},
{
"name": "drop article.author",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_relationship",
"body": {
"table": "article",
"relationship": "author"
}
}
},
{
"name": "drop col",
"url": "/api/1/query",
"role": "admin",
"status_code": 400,
"method": "POST",
"user_id": "1",
"response": {
"path": "$",
"error": "can not delete due to the following dependent objects - [(\"article\",foreign_key_constraint,\"article_author_id_fkey\"),(\"author\",relationship,\"articles\")]"
},
"request": {
"kind": "drop_column",
"body": {
"table": "article",
"column": "author_id",
"cascade": false
}
}
},
{
"name": "drop author.articles",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_relationship",
"body": {
"table": "author",
"relationship": "articles"
}
}
},
{
"name": "drop col",
"url": "/api/1/query",
"role": "admin",
"status_code": 400,
"method": "POST",
"user_id": "1",
"response": {
"path": "$",
"error": "can not delete due to the following dependent objects - [(\"article\",foreign_key_constraint,\"article_author_id_fkey\")]"
},
"request": {
"kind": "drop_column",
"body": {
"table": "article",
"column": "author_id",
"cascade": false
}
}
},
{
"name": "drop article_author_id_fkey",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_constraint",
"body": {
"table": "article",
"constraint": "article_author_id_fkey"
}
}
},
{
"name": "drop col",
"url": "/api/1/query",
"role": "admin",
"status_code": 200,
"method": "POST",
"user_id": "1",
"request": {
"kind": "drop_column",
"body": {
"table": "article",
"column": "author_id",
"cascade": false
}
}
}
]
}