| @@ 718-734 (lines=17) @@ | ||
| 715 | case static::PHINX_TYPE_CHAR: |
|
| 716 | return ['name' => 'char', 'limit' => $limit ? $limit : 255]; |
|
| 717 | break; |
|
| 718 | case static::PHINX_TYPE_TEXT: |
|
| 719 | if ($limit) { |
|
| 720 | $sizes = [ |
|
| 721 | // Order matters! Size must always be tested from longest to shortest! |
|
| 722 | 'longtext' => static::TEXT_LONG, |
|
| 723 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 724 | 'text' => static::TEXT_REGULAR, |
|
| 725 | 'tinytext' => static::TEXT_SMALL, |
|
| 726 | ]; |
|
| 727 | foreach ($sizes as $name => $length) { |
|
| 728 | if ($limit >= $length) { |
|
| 729 | return ['name' => $name]; |
|
| 730 | } |
|
| 731 | } |
|
| 732 | } |
|
| 733 | return ['name' => 'text']; |
|
| 734 | break; |
|
| 735 | case static::PHINX_TYPE_BINARY: |
|
| 736 | return ['name' => 'binary', 'limit' => $limit ? $limit : 255]; |
|
| 737 | break; |
|
| @@ 741-757 (lines=17) @@ | ||
| 738 | case static::PHINX_TYPE_VARBINARY: |
|
| 739 | return ['name' => 'varbinary', 'limit' => $limit ? $limit : 255]; |
|
| 740 | break; |
|
| 741 | case static::PHINX_TYPE_BLOB: |
|
| 742 | if ($limit) { |
|
| 743 | $sizes = [ |
|
| 744 | // Order matters! Size must always be tested from longest to shortest! |
|
| 745 | 'longblob' => static::BLOB_LONG, |
|
| 746 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 747 | 'blob' => static::BLOB_REGULAR, |
|
| 748 | 'tinyblob' => static::BLOB_SMALL, |
|
| 749 | ]; |
|
| 750 | foreach ($sizes as $name => $length) { |
|
| 751 | if ($limit >= $length) { |
|
| 752 | return ['name' => $name]; |
|
| 753 | } |
|
| 754 | } |
|
| 755 | } |
|
| 756 | return ['name' => 'blob']; |
|
| 757 | break; |
|
| 758 | case static::PHINX_TYPE_INTEGER: |
|
| 759 | if ($limit && $limit >= static::INT_TINY) { |
|
| 760 | $sizes = [ |
|