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