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
             'timestamp_with_timezone' => 'timestamp',
2619
             'timestamp_with_timezone' => 'timestamp',
2620
         ],
2620
         ],
2621
         'mysql' => [
2621
         'mysql' => [
2622
-            'tinyint(1)' => 'boolean',
2623
-            'bit(0)' => 'boolean',
2624
-            'bit(1)' => 'boolean',
2622
+            'bit' => 'boolean',
2625
             'tinyblob' => 'blob',
2623
             'tinyblob' => 'blob',
2626
             'mediumblob' => 'blob',
2624
             'mediumblob' => 'blob',
2627
             'longblob' => 'blob',
2625
             'longblob' => 'blob',

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

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

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

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

Loading…
Cancel
Save