Browse Source

tinyint with display width 1 does not map to boolean, see: #526

Maurits van der Schee 5 years ago
parent
commit
e89b60876b
3 changed files with 2 additions and 5 deletions
  1. 1
    3
      api.php
  2. 0
    1
      src/Tqdev/PhpCrudApi/Database/TypeConverter.php
  3. 1
    1
      tests/fixtures/blog_mysql.sql

+ 1
- 3
api.php View File

@@ -2619,9 +2619,7 @@ class TypeConverter
2619 2619
             'timestamp_with_timezone' => 'timestamp',
2620 2620
         ],
2621 2621
         'mysql' => [
2622
-            'tinyint(1)' => 'boolean',
2623
-            'bit(0)' => 'boolean',
2624
-            'bit(1)' => 'boolean',
2622
+            'bit' => 'boolean',
2625 2623
             'tinyblob' => 'blob',
2626 2624
             'mediumblob' => 'blob',
2627 2625
             'longblob' => 'blob',

+ 0
- 1
src/Tqdev/PhpCrudApi/Database/TypeConverter.php View File

@@ -46,7 +46,6 @@ class TypeConverter
46 46
             'timestamp_with_timezone' => 'timestamp',
47 47
         ],
48 48
         'mysql' => [
49
-            'tinyint(1)' => 'boolean',
50 49
             'bit(0)' => 'boolean',
51 50
             'bit(1)' => 'boolean',
52 51
             'tinyblob' => 'blob',

+ 1
- 1
tests/fixtures/blog_mysql.sql View File

@@ -75,7 +75,7 @@ DROP TABLE IF EXISTS `tags`;
75 75
 CREATE TABLE `tags` (
76 76
   `id` int(11) NOT NULL AUTO_INCREMENT,
77 77
   `name` varchar(255) NOT NULL,
78
-  `is_important` bit(1) NOT NULL,
78
+  `is_important` tinyint(1) NOT NULL,
79 79
   PRIMARY KEY (`id`)
80 80
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
81 81
 

Loading…
Cancel
Save