Hi!
So I am amazed by DreamFactory. This is exactly what I needed and I am really thankful for people involved.
Yet there is one thing that bugs me. I can’t create unique keys in my database. I am using Free Edition hosted dsp, with Local SQL Databse named ThornDb.
When I create a table with unique property via schema ( accordingly to the wiki ) it updates with response 200. But when I then use API Docs to get back the schema it differs and doesn’t have “is_unique” property. I also tried creating new table in “Schema” view of DF, then added some normal fields and one with checkbox “unique” checked. I updated everything every step and got green notifications saying every action was successful. Yet my field isn’t unique and I can’t make relationship to other table (I know that I can do it with primary key but I would prefer to make it with unique one).
Here is what I post (createTable()):
{
"name": "Test20152170052",
"field": [
{
"name": "Id",
"type": "id",
"default_value": "aaa",
"required": true,
"allow_null": false,
"fixed_length": false,
"supports_multibyte": false,
"auto_increment": true,
"is_primary_key": true,
"validation": [
""
],
"value": [
""
]
},
{
"name": "unique",
"type": "string",
"default_value": "aaa",
"required": true,
"allow_null": false,
"fixed_length": false,
"supports_multibyte": false,
"auto_increment": false,
"is_primary_key": false,
"is_foreign_key": false,
"is_index": false,
"is_unique": true,
"ref_table": "",
"ref_fields": "",
"validation": [
""
],
"value": [
""
]
}
]
}
Here is what i get (describeTable()):
{
"name": "Test20152170052",
"label": "Test20152170052",
"plural": "Test20152170052s",
"primary_key": "Id",
"name_field": null,
"field": [
{
"name": "Id",
"label": "Id",
"type": "id",
"db_type": "int(11)",
"length": 11,
"precision": 11,
"scale": 0,
"default": null,
"required": false,
"allow_null": false,
"fixed_length": false,
"supports_multibyte": false,
"auto_increment": true,
"is_primary_key": true,
"is_foreign_key": false,
"ref_table": "",
"ref_fields": "",
"validation": [
""
],
"value": []
},
{
"name": "unique",
"label": "Unique",
"type": "string",
"db_type": "varchar(255)",
"length": 255,
"precision": 255,
"scale": 0,
"default": null,
"required": true,
"allow_null": false,
"fixed_length": false,
"supports_multibyte": true,
"auto_increment": false,
"is_primary_key": false,
"is_foreign_key": false,
"ref_table": "",
"ref_fields": "",
"validation": [
""
],
"value": []
}
],
"related": [],
"access": [
"GET",
"POST",
"PUT",
"PATCH",
"MERGE",
"DELETE"
]
}
Could You help me? I am fighting with this for hours. Thanks in advice.