| @@ 760-776 (lines=17) @@ | ||
| 757 | return ['name' => 'varchar', 'limit' => $limit ?: 255]; |
|
| 758 | case static::PHINX_TYPE_CHAR: |
|
| 759 | return ['name' => 'char', 'limit' => $limit ?: 255]; |
|
| 760 | case static::PHINX_TYPE_TEXT: |
|
| 761 | if ($limit) { |
|
| 762 | $sizes = [ |
|
| 763 | // Order matters! Size must always be tested from longest to shortest! |
|
| 764 | 'longtext' => static::TEXT_LONG, |
|
| 765 | 'mediumtext' => static::TEXT_MEDIUM, |
|
| 766 | 'text' => static::TEXT_REGULAR, |
|
| 767 | 'tinytext' => static::TEXT_SMALL, |
|
| 768 | ]; |
|
| 769 | foreach ($sizes as $name => $length) { |
|
| 770 | if ($limit >= $length) { |
|
| 771 | return ['name' => $name]; |
|
| 772 | } |
|
| 773 | } |
|
| 774 | } |
|
| 775 | ||
| 776 | return ['name' => 'text']; |
|
| 777 | case static::PHINX_TYPE_BINARY: |
|
| 778 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 779 | case static::PHINX_TYPE_VARBINARY: |
|
| @@ 781-797 (lines=17) @@ | ||
| 778 | return ['name' => 'binary', 'limit' => $limit ?: 255]; |
|
| 779 | case static::PHINX_TYPE_VARBINARY: |
|
| 780 | return ['name' => 'varbinary', 'limit' => $limit ?: 255]; |
|
| 781 | case static::PHINX_TYPE_BLOB: |
|
| 782 | if ($limit) { |
|
| 783 | $sizes = [ |
|
| 784 | // Order matters! Size must always be tested from longest to shortest! |
|
| 785 | 'longblob' => static::BLOB_LONG, |
|
| 786 | 'mediumblob' => static::BLOB_MEDIUM, |
|
| 787 | 'blob' => static::BLOB_REGULAR, |
|
| 788 | 'tinyblob' => static::BLOB_SMALL, |
|
| 789 | ]; |
|
| 790 | foreach ($sizes as $name => $length) { |
|
| 791 | if ($limit >= $length) { |
|
| 792 | return ['name' => $name]; |
|
| 793 | } |
|
| 794 | } |
|
| 795 | } |
|
| 796 | ||
| 797 | return ['name' => 'blob']; |
|
| 798 | case static::PHINX_TYPE_BIT: |
|
| 799 | return ['name' => 'bit', 'limit' => $limit ?: 64]; |
|
| 800 | case static::PHINX_TYPE_INTEGER: |
|