Skip to content

Commit e89b608

Browse files
committed
tinyint with display width 1 does not map to boolean, see: #526
1 parent 5e956f7 commit e89b608

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

api.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,9 +2619,7 @@ public function __construct(String $driver)
26192619
'timestamp_with_timezone' => 'timestamp',
26202620
],
26212621
'mysql' => [
2622-
'tinyint(1)' => 'boolean',
2623-
'bit(0)' => 'boolean',
2624-
'bit(1)' => 'boolean',
2622+
'bit' => 'boolean',
26252623
'tinyblob' => 'blob',
26262624
'mediumblob' => 'blob',
26272625
'longblob' => 'blob',

src/Tqdev/PhpCrudApi/Database/TypeConverter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function __construct(String $driver)
4646
'timestamp_with_timezone' => 'timestamp',
4747
],
4848
'mysql' => [
49-
'tinyint(1)' => 'boolean',
5049
'bit(0)' => 'boolean',
5150
'bit(1)' => 'boolean',
5251
'tinyblob' => 'blob',

tests/fixtures/blog_mysql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DROP TABLE IF EXISTS `tags`;
7575
CREATE TABLE `tags` (
7676
`id` int(11) NOT NULL AUTO_INCREMENT,
7777
`name` varchar(255) NOT NULL,
78-
`is_important` bit(1) NOT NULL,
78+
`is_important` tinyint(1) NOT NULL,
7979
PRIMARY KEY (`id`)
8080
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
8181

0 commit comments

Comments
 (0)