Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
21.82k stars 1.5k forks source link

Changing Option Field in Data Interface Causes Boolean ValidationError MariaDB #13374

Open Stropdasman opened 5 months ago

Stropdasman commented 5 months ago

Checklist

Hosting

Describe the bug Boolean value gives the following error when attempting to change option field in data interface

{
    "message": "Bad Request",
    "status": 400,
    "validationErrors": {
        "assigned": [
            "must be of type boolean"
        ]
    }
}

Desktop (please complete the following information):

https://github.com/Budibase/budibase/assets/147417929/9132b651-4685-44b3-8480-4723c3fd93c1

linear[bot] commented 5 months ago

BUDI-8138 Changing Option Field in Data Interface Causes Boolean ValidationError MariaDB

ConorWebb96 commented 5 months ago

Hey @Stropdasman,

Can you provide your table create script I wasn't able to replicate this behaviour. What happens if you un-check and re-check the boolean field?

Stropdasman commented 5 months ago

Hi @ConorWebb96

This is the create table script.

CREATE TABLE `transport_request` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `created` datetime NOT NULL,
  `last_modified` datetime NOT NULL,
  `status` text NOT NULL,
  `assigned_transport` int(11) DEFAULT NULL,
  `departure` text NOT NULL,
  `destination` text NOT NULL,
  `item_type` text NOT NULL,
  `amount` text NOT NULL,
  `requested_delivery_date` date DEFAULT NULL,
  `delivery_asap` tinyint(1) DEFAULT NULL,
  `assigned` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

When i check it and uncheck it, it works.

ConorWebb96 commented 5 months ago

Thanks very much for the above schema,

This seems to be MariaDB specific. It is a valid bug, but my advice going forward is to always make sure a value for your bool fields is set before creating/amending records.