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