| @@ 851-867 (lines=17) @@ | ||
| 848 | return ['name' => 'varchar', 'limit' => $limit ?: 255]; |
|
| 849 | case static::PHINX_TYPE_CHAR: |
|
| 850 | return ['name' => 'char', 'limit' => $limit ?: 255]; |
|
| 851 | case static::PHINX_TYPE_TEXT: |
|
| 852 | if ($limit) { |
|
| 853 | $sizes = [ |
|
| 854 | // Order matters! Size must always be tested from longest to shortest! |
|
| 855 | 'longtext' => static::TEXT_LONG, |
|
| 856 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 857 | 'text' => static::TEXT_REGULAR, |
|
| 858 | 'tinytext' => static::TEXT_SMALL, |
|
| 859 | ]; |
|
| 860 | foreach ($sizes as $name => $length) { |
|
| 861 | if ($limit >= $length) { |
|
| 862 | return ['name' => $name]; |
|
| 863 | } |
|
| 864 | } |
|
| 865 | } |
|
| 866 | ||
| 867 | return ['name' => 'text']; |
|
| 868 | case static::PHINX_TYPE_BINARY: |
|
| 869 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 870 | case static::PHINX_TYPE_VARBINARY: |
|
| @@ 872-888 (lines=17) @@ | ||
| 869 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 870 | case static::PHINX_TYPE_VARBINARY: |
|
| 871 | return ['name' => 'varbinary', 'limit' => $limit ?: 255]; |
|
| 872 | case static::PHINX_TYPE_BLOB: |
|
| 873 | if ($limit) { |
|
| 874 | $sizes = [ |
|
| 875 | // Order matters! Size must always be tested from longest to shortest! |
|
| 876 | 'longblob' => static::BLOB_LONG, |
|
| 877 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 878 | 'blob' => static::BLOB_REGULAR, |
|
| 879 | 'tinyblob' => static::BLOB_SMALL, |
|
| 880 | ]; |
|
| 881 | foreach ($sizes as $name => $length) { |
|
| 882 | if ($limit >= $length) { |
|
| 883 | return ['name' => $name]; |
|
| 884 | } |
|
| 885 | } |
|
| 886 | } |
|
| 887 | ||
| 888 | return ['name' => 'blob']; |
|
| 889 | case static::PHINX_TYPE_BIT: |
|
| 890 | return ['name' => 'bit', 'limit' => $limit ?: 64]; |
|
| 891 | case static::PHINX_TYPE_INTEGER: |
|