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