| @@ 898-914 (lines=17) @@ | ||
| 895 | return ['name' => 'varchar', 'limit' => $limit ?: 255]; |
|
| 896 | case static::PHINX_TYPE_CHAR: |
|
| 897 | return ['name' => 'char', 'limit' => $limit ?: 255]; |
|
| 898 | case static::PHINX_TYPE_TEXT: |
|
| 899 | if ($limit) { |
|
| 900 | $sizes = [ |
|
| 901 | // Order matters! Size must always be tested from longest to shortest! |
|
| 902 | 'longtext' => static::TEXT_LONG, |
|
| 903 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 904 | 'text' => static::TEXT_REGULAR, |
|
| 905 | 'tinytext' => static::TEXT_SMALL, |
|
| 906 | ]; |
|
| 907 | foreach ($sizes as $name => $length) { |
|
| 908 | if ($limit >= $length) { |
|
| 909 | return ['name' => $name]; |
|
| 910 | } |
|
| 911 | } |
|
| 912 | } |
|
| 913 | ||
| 914 | return ['name' => 'text']; |
|
| 915 | case static::PHINX_TYPE_BINARY: |
|
| 916 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 917 | case static::PHINX_TYPE_VARBINARY: |
|
| @@ 919-935 (lines=17) @@ | ||
| 916 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 917 | case static::PHINX_TYPE_VARBINARY: |
|
| 918 | return ['name' => 'varbinary', 'limit' => $limit ?: 255]; |
|
| 919 | case static::PHINX_TYPE_BLOB: |
|
| 920 | if ($limit) { |
|
| 921 | $sizes = [ |
|
| 922 | // Order matters! Size must always be tested from longest to shortest! |
|
| 923 | 'longblob' => static::BLOB_LONG, |
|
| 924 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 925 | 'blob' => static::BLOB_REGULAR, |
|
| 926 | 'tinyblob' => static::BLOB_SMALL, |
|
| 927 | ]; |
|
| 928 | foreach ($sizes as $name => $length) { |
|
| 929 | if ($limit >= $length) { |
|
| 930 | return ['name' => $name]; |
|
| 931 | } |
|
| 932 | } |
|
| 933 | } |
|
| 934 | ||
| 935 | return ['name' => 'blob']; |
|
| 936 | case static::PHINX_TYPE_BIT: |
|
| 937 | return ['name' => 'bit', 'limit' => $limit ?: 64]; |
|
| 938 | case static::PHINX_TYPE_INTEGER: |
|