| @@ 735-751 (lines=17) @@ | ||
| 732 | return [ 'name' => 'varchar', 'limit' => $limit ?: 255 ]; |
|
| 733 | case static::PHINX_TYPE_CHAR: |
|
| 734 | return [ 'name' => 'char', 'limit' => $limit ?: 255 ]; |
|
| 735 | case static::PHINX_TYPE_TEXT: |
|
| 736 | if ($limit) { |
|
| 737 | $sizes = [ |
|
| 738 | // Order matters! Size must always be tested from longest to shortest! |
|
| 739 | 'longtext' => static::TEXT_LONG, |
|
| 740 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 741 | 'text' => static::TEXT_REGULAR, |
|
| 742 | 'tinytext' => static::TEXT_SMALL, |
|
| 743 | ]; |
|
| 744 | foreach ($sizes as $name => $length) { |
|
| 745 | if ($limit >= $length) { |
|
| 746 | return [ 'name' => $name ]; |
|
| 747 | } |
|
| 748 | } |
|
| 749 | } |
|
| 750 | ||
| 751 | return [ 'name' => 'text' ]; |
|
| 752 | case static::PHINX_TYPE_BINARY: |
|
| 753 | return [ 'name' => 'binary', 'limit' => $limit ?: 255 ]; |
|
| 754 | case static::PHINX_TYPE_VARBINARY: |
|
| @@ 756-772 (lines=17) @@ | ||
| 753 | return [ 'name' => 'binary', 'limit' => $limit ?: 255 ]; |
|
| 754 | case static::PHINX_TYPE_VARBINARY: |
|
| 755 | return [ 'name' => 'varbinary', 'limit' => $limit ?: 255 ]; |
|
| 756 | case static::PHINX_TYPE_BLOB: |
|
| 757 | if ($limit) { |
|
| 758 | $sizes = [ |
|
| 759 | // Order matters! Size must always be tested from longest to shortest! |
|
| 760 | 'longblob' => static::BLOB_LONG, |
|
| 761 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 762 | 'blob' => static::BLOB_REGULAR, |
|
| 763 | 'tinyblob' => static::BLOB_SMALL, |
|
| 764 | ]; |
|
| 765 | foreach ($sizes as $name => $length) { |
|
| 766 | if ($limit >= $length) { |
|
| 767 | return [ 'name' => $name ]; |
|
| 768 | } |
|
| 769 | } |
|
| 770 | } |
|
| 771 | ||
| 772 | return [ 'name' => 'blob' ]; |
|
| 773 | case static::PHINX_TYPE_BIT: |
|
| 774 | return [ 'name' => 'bit', 'limit' => $limit ?: 64 ]; |
|
| 775 | case static::PHINX_TYPE_INTEGER: |
|