Hi, I am using Postgres in the back-end and I want to create a table, so I created a schema first by using the following command:
curl -X POST \
-H "X-Parse-Application-Id: xxxxxx" \
-H "X-Parse-Master-Key: xxxxxx" \
-H "Content-Type: application/json" \
-d '
{
"className": "PaymentHistory",
"fields": {
"paymentMethod": {
"type": "String"
},
"paymentTime": {
"type": "Date"
},
"paymentAmount": {
"type": "Number"
},
"paymentStatus": {
"type": "Boolean"
}
}
}' \
http://127.0.0.1:1337/parse/schemas/PaymentHistory
Parse server already has a _User table with objectid and username. objectid is the primary key in the _User table. I want to link my PaymentHistory table by using the objectid in the _User table as the foreign key in my PaymentHistory table. How do I change my curl command to create the foreign key?
I know there is a relations section in the document: REST API Guide | Parse
But the document is not very clear and I still don’t know how to use it.
I understand parse server works better with MongoDB, but I cannot install MongoDB in my system. So, I have to use Postgres. I just hope there is a way to create a foreign key relation via curl. Thanks