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