I recently partitioned my mysql table to increase the performance.
The table name was “log” with “logid” as the primary key. I wanted partitioning to be done based on column called “devid” which is non unique. So partitioning required that devid needs to be a primary key. So i altered table to make both logid and devid as the primary keys and completed the partition.
After partition whenever i make a create request using HTTP post to mysql table api. I get the devid back in resource. Before i used to logid back.
Also i have tried entering the fields= parameter along with data but it gives me 500 Error
I am trying this URL
/api/v2/mysql/_table/log?fields=devid — works ok
/api/v2/mysql/_table/log?fields=logid — gives 500 Error
What changes can i make so that REST API returns the newly added Logid only.
Here is the schema of the table.
{
“alias”: null,
“name”: “log”,
“is_view”: false,
“label”: “Log”,
“plural”: “Logs”,
“description”: null,
“primary_key”: [
“devid”,
“logid”
],
“name_field”: null,
“field”: [
{
“alias”: null,
“name”: “devid”,
“label”: “Device ID”,
“description”: null,
“type”: “integer”,
“db_type”: “int(11)”,
“length”: 11,
“precision”: null,
“scale”: null,
“default”: null,
“required”: true,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: false,
“auto_increment”: false,
“is_primary_key”: true,
“is_unique”: false,
“is_index”: false,
“is_foreign_key”: false,
“is_virtual_foreign_key”: false,
“is_foreign_ref_service”: false,
“ref_service”: null,
“ref_service_id”: null,
“ref_table”: null,
“ref_fields”: null,
“ref_on_update”: null,
“ref_on_delete”: null,
“picklist”: null,
“validation”: null,
“db_function”: null
},
{
“alias”: null,
“name”: “logid”,
“label”: “Log ID”,
“description”: null,
“type”: “id”,
“db_type”: “int(11)”,
“length”: 11,
“precision”: null,
“scale”: null,
“default”: null,
“required”: false,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: false,
“auto_increment”: true,
“is_primary_key”: true,
“is_unique”: false,
“is_index”: false,
“is_foreign_key”: false,
“is_virtual_foreign_key”: false,
“is_foreign_ref_service”: false,
“ref_service”: null,
“ref_service_id”: null,
“ref_table”: null,
“ref_fields”: null,
“ref_on_update”: null,
“ref_on_delete”: null,
“picklist”: null,
“validation”: null,
“db_function”: null
},
],
“related”: [],
“access”: 31
}