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