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