Skip to content

Commit c79301a

Browse files
authored
Merge pull request #7 from basi/work/add_mysql_type_2
Add support for MEDIUMTEXT and MEDIUMBLOB MySQL column types
2 parents 59a7f41 + 45bcead commit c79301a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/Cake/Model/Datasource/Database/Mysql.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class Mysql extends DboSource {
120120
'primary_key' => array('name' => 'NOT NULL AUTO_INCREMENT'),
121121
'string' => array('name' => 'varchar', 'limit' => '255'),
122122
'text' => array('name' => 'text'),
123+
'mediumtext' => array('name' => 'mediumtext'),
123124
'enum' => array('name' => 'enum'),
124125
'biginteger' => array('name' => 'bigint', 'limit' => '20'),
125126
'integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'),
@@ -132,6 +133,7 @@ class Mysql extends DboSource {
132133
'time' => array('name' => 'time', 'format' => 'H:i:s', 'formatter' => 'date'),
133134
'date' => array('name' => 'date', 'format' => 'Y-m-d', 'formatter' => 'date'),
134135
'binary' => array('name' => 'blob'),
136+
'mediumblob' => array('name' => 'mediumblob'),
135137
'boolean' => array('name' => 'tinyint', 'limit' => '1')
136138
);
137139

@@ -812,9 +814,15 @@ public function column($real) {
812814
if (strpos($col, 'char') !== false || $col === 'tinytext') {
813815
return 'string';
814816
}
817+
if (strpos($col, 'mediumtext') !== false) {
818+
return 'mediumtext';
819+
}
815820
if (strpos($col, 'text') !== false) {
816821
return 'text';
817822
}
823+
if (strpos($col, 'mediumblob') !== false) {
824+
return 'mediumblob';
825+
}
818826
if (strpos($col, 'blob') !== false || $col === 'binary') {
819827
return 'binary';
820828
}

0 commit comments

Comments
 (0)