| @@ 881-897 (lines=17) @@ | ||
| 878 | return ['name' => 'varchar', 'limit' => $limit ?: 255]; |
|
| 879 | case static::PHINX_TYPE_CHAR: |
|
| 880 | return ['name' => 'char', 'limit' => $limit ?: 255]; |
|
| 881 | case static::PHINX_TYPE_TEXT: |
|
| 882 | if ($limit) { |
|
| 883 | $sizes = [ |
|
| 884 | // Order matters! Size must always be tested from longest to shortest! |
|
| 885 | 'longtext' => static::TEXT_LONG, |
|
| 886 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 887 | 'text' => static::TEXT_REGULAR, |
|
| 888 | 'tinytext' => static::TEXT_SMALL, |
|
| 889 | ]; |
|
| 890 | foreach ($sizes as $name => $length) { |
|
| 891 | if ($limit >= $length) { |
|
| 892 | return ['name' => $name]; |
|
| 893 | } |
|
| 894 | } |
|
| 895 | } |
|
| 896 | ||
| 897 | return ['name' => 'text']; |
|
| 898 | case static::PHINX_TYPE_BINARY: |
|
| 899 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 900 | case static::PHINX_TYPE_VARBINARY: |
|
| @@ 902-918 (lines=17) @@ | ||
| 899 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 900 | case static::PHINX_TYPE_VARBINARY: |
|
| 901 | return ['name' => 'varbinary', 'limit' => $limit ?: 255]; |
|
| 902 | case static::PHINX_TYPE_BLOB: |
|
| 903 | if ($limit) { |
|
| 904 | $sizes = [ |
|
| 905 | // Order matters! Size must always be tested from longest to shortest! |
|
| 906 | 'longblob' => static::BLOB_LONG, |
|
| 907 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 908 | 'blob' => static::BLOB_REGULAR, |
|
| 909 | 'tinyblob' => static::BLOB_SMALL, |
|
| 910 | ]; |
|
| 911 | foreach ($sizes as $name => $length) { |
|
| 912 | if ($limit >= $length) { |
|
| 913 | return ['name' => $name]; |
|
| 914 | } |
|
| 915 | } |
|
| 916 | } |
|
| 917 | ||
| 918 | return ['name' => 'blob']; |
|
| 919 | case static::PHINX_TYPE_BIT: |
|
| 920 | return ['name' => 'bit', 'limit' => $limit ?: 64]; |
|
| 921 | case static::PHINX_TYPE_INTEGER: |
|