@@ 702-718 (lines=17) @@ | ||
699 | case static::PHINX_TYPE_CHAR: |
|
700 | return ['name' => 'char', 'limit' => $limit ? $limit : 255]; |
|
701 | break; |
|
702 | case static::PHINX_TYPE_TEXT: |
|
703 | if ($limit) { |
|
704 | $sizes = [ |
|
705 | // Order matters! Size must always be tested from longest to shortest! |
|
706 | 'longtext' => static::TEXT_LONG, |
|
707 | 'mediumtext' => static::TEXT_MEDIUM, |
|
708 | 'text' => static::TEXT_REGULAR, |
|
709 | 'tinytext' => static::TEXT_SMALL, |
|
710 | ]; |
|
711 | foreach ($sizes as $name => $length) { |
|
712 | if ($limit >= $length) { |
|
713 | return ['name' => $name]; |
|
714 | } |
|
715 | } |
|
716 | } |
|
717 | return ['name' => 'text']; |
|
718 | break; |
|
719 | case static::PHINX_TYPE_BINARY: |
|
720 | return ['name' => 'binary', 'limit' => $limit ? $limit : 255]; |
|
721 | break; |
|
@@ 725-741 (lines=17) @@ | ||
722 | case static::PHINX_TYPE_VARBINARY: |
|
723 | return ['name' => 'varbinary', 'limit' => $limit ? $limit : 255]; |
|
724 | break; |
|
725 | case static::PHINX_TYPE_BLOB: |
|
726 | if ($limit) { |
|
727 | $sizes = [ |
|
728 | // Order matters! Size must always be tested from longest to shortest! |
|
729 | 'longblob' => static::BLOB_LONG, |
|
730 | 'mediumblob' => static::BLOB_MEDIUM, |
|
731 | 'blob' => static::BLOB_REGULAR, |
|
732 | 'tinyblob' => static::BLOB_SMALL, |
|
733 | ]; |
|
734 | foreach ($sizes as $name => $length) { |
|
735 | if ($limit >= $length) { |
|
736 | return ['name' => $name]; |
|
737 | } |
|
738 | } |
|
739 | } |
|
740 | return ['name' => 'blob']; |
|
741 | break; |
|
742 | case static::PHINX_TYPE_INTEGER: |
|
743 | if ($limit && $limit >= static::INT_TINY) { |
|
744 | $sizes = [ |