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