I am trying to let users create rows from the ForestAdmin. Most tables have an
id column that stores a unique UUID for that row. It’s a bad user experience to make a user generate a UUID to then plug into the create form. So the thinking was, let MySQL generate that UUID.
| clients | CREATE TABLE `clients` ( `id` char(36) NOT NULL DEFAULT (uuid()), `name` varchar(255) DEFAULT NULL, `slug` varchar(15) NOT NULL, `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `slug` (`slug`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
This works fine. However, ForestAdmin tries to insert the string “uuid()” everytime a row is created now. Is there anyway to trick ForestAdmin into not inserting anything in that
Is there some alternative way here? I definitely don’t want to change all my tables away from UUIDs but I will if that is impossible to have with Forest. I don’t want users to have to generate a UUID to plug into a create form field.
- Project name: refinition-data
- Database type: MySQL 8