status_test collection without the status fieldstatus field using the status field type and make it required.Here's screen recording
The item is actually saved in the database but the status value in db is raf.

Here's the field structure:
{
"type": "status",
"datatype": "VARCHAR",
"length": 20,
"field": "status",
"interface": "status",
"default_value": "draft",
"width": "full",
"options": {
"status_mapping": {
"published": {
"name": "Published",
"value": "published",
"text_color": "white",
"background_color": "accent",
"browse_subdued": false,
"browse_badge": true,
"soft_delete": false,
"published": true
},
"draft": {
"name": "Draft",
"value": "draft",
"text_color": "white",
"background_color": "blue-grey-100",
"browse_subdued": true,
"browse_badge": true,
"soft_delete": false,
"published": false
},
"deleted": {
"name": "Deleted",
"value": "deleted",
"text_color": "white",
"background_color": "red",
"browse_subdued": true,
"browse_badge": true,
"soft_delete": true,
"published": false
}
}
},
"required": true
}
Hey @JbalTero
Not able to replicate this. @rijkvanzanten can you please verify this once?
@bjgajjar @rijkvanzanten I'm upgraded now to Spouting Whale — (190807A)
Still the same issue, here's a screenrecording of what happens when I add status field manually.
@JbalTero — I am not able to reproduce this neither in my local nor in the latest release.
Don't know the exact reason, why you are getting this issue at your end! Maybe @rijkvanzanten can help you here.
@bjgajjar I was also able to reproduce this in my remote test server.
Hey @JbalTero — did you try replicating on the Directus demo? That might be useful since it's a shared system. Otherwise, could you send us a database dump to help debug?
@benhaynes it works fine in the Directus Demo, are you using MariaDb in that?
MySQL I believe.
@benhaynes @bjgajjar @rijkvanzanten
I think this isssue is specific in MariaDb, Check my recording.
The field's default value is getting trimmed in its first and last character. In line src/core/Directus/Database/Schema/SchemaManager.php:676
Ugh, this issue has come up before. We need to solve this "trims first/last character" issue once and for all. At least now we know it's likely a MariaDB specific problem.
🔔 @directus/api-team
This issue is gone if you create a collection with status field pre-selected.
@JbalTero
I checked this in MariaDB but still not able to replicate over there :(
@bjgajjar Using MariaDB, did it go inside src/core/Directus/Database/Schema/SchemaManager.php:672?
Yes
@bjgajjar @benhaynes
This issue occurs in Mariadb 10.1, but not on Mariadb 10.2+
It is because the column_default in 10.1 is not quoted, while starting 10.2, column_default is quoted.
Changes & Improvements in MariaDB 10.2

That's the reason @bjgajjar was not able to replicate on her side since she is using 10.2, while I'm using 10.1
Closing this as it is not Directus related.
Let's plan on adding a minimum MariaDB version to the docs. If someone wants to submit a PR to fix this we'll review.
Thanks @shealavington
https://github.com/directus/docs/commit/7b1404a448a8ab3f8b79f01ef59cd52f2bc829d4
Most helpful comment
Ugh, this issue has come up before. We need to solve this "trims first/last character" issue once and for all. At least now we know it's likely a MariaDB specific problem.
🔔 @directus/api-team