5use Doctrine\DBAL\Platforms\AbstractPlatform;
6use Doctrine\DBAL\Types\Type;
18 public const ENUM =
'mwenum';
30 if ( $platform->getName() ==
'sqlite' ) {
38 if ( $platform->getName() ==
'postgresql' ) {
39 if ( !$column[
'fixed'] ) {
43 return strtoupper( $column[
'name'] .
'_enum' );
46 if ( $platform->getName() ==
'mysql' ) {
47 $enumValues = $this->
formatValues( $column[
'enum_values'] );
48 return "ENUM( $enumValues )";
63 if ( $platform->getName() !==
'postgresql' ) {
64 throw new \InvalidArgumentException(
65 __METHOD__ .
' can only be called on Postgres platform'
69 $enumName = strtoupper( $column[
'name'] .
'_enum' );
70 $enumValues = $this->
formatValues( $column[
'enum_values'] );
71 $typeSql =
"\n\nCREATE TYPE $enumName AS ENUM( $enumValues )";
83 $values = implode(
"','", $values );
84 $enumValues =
"'" . $values .
"'";