5use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
6use Wikimedia\Timestamp\ConvertibleTimestamp;
17 $type = $column[
'type'];
18 $default = $column[
'default'] ??
null;
21 if ( isset( $column[
'allowInfinite'] ) &&
22 $column[
'allowInfinite'] &&
23 $default ===
'infinity'
25 $pgTimestamp = $default;
27 $timestamp =
new ConvertibleTimestamp( $default );
28 $pgTimestamp = $timestamp->getTimestamp( TS_POSTGRES );
31 return " DEFAULT '$pgTimestamp' ";
34 return parent::getDefaultValueDeclarationSQL( $column );
43 $tableSql = parent::_getCreateTableSQL( $name, $columns, $options );
44 foreach ( $columns as $column ) {
45 if ( $column[
'type'] instanceof
EnumType && $column[
'fixed'] ) {
50 $typeSql = $column[
'type']->makeEnumTypeSql( $column, $this );
51 array_unshift( $tableSql, $typeSql );
getFloatDeclarationSQL(array $column)
getDefaultValueDeclarationSQL( $column)
Handles Postgres unique timestamp format .
getDateTimeTzTypeDeclarationSQL(array $column)
getBlobTypeDeclarationSQL(array $column)
_getCreateTableSQL( $name, $columns, array $options=[])
phpcs:disable PSR2.Methods.MethodDeclaration.Underscore
getBinaryTypeDeclarationSQL(array $column)