src/RocknRoot/StrayFw/Database/Postgres/Mutation/DeleteColumn.php
public static function statement(Database $database, array $schema, string $modelName, string $tableName, string $fieldName)
    {
        $fieldDefinition = $schema[$modelName]['fields'][$fieldName];
        $fieldRealName = null;
        if (isset($fieldDefinition['name']) === true) {
            $fieldRealName = $fieldDefinition['name'];
        } else {
            $fieldRealName = Helper::codifyName($modelName) . '_' . Helper::codifyName($fieldName);
        }
        $sql = 'ALTER TABLE ' . $tableName . ' DROP COLUMN ' . $fieldRealName;
        $statement = $database->getMasterLink()->prepare($sql);
        return $statement;
    }
public static function statement(Database $database, array $schema, string $modelName, string $tableName, string $fieldName)
    {
        $fieldDefinition = $schema[$modelName]['fields'][$fieldName];
        $fieldRealName = null;
        if (isset($fieldDefinition['name']) === true) {
            $fieldRealName = $fieldDefinition['name'];
        } else {
            $fieldRealName = Helper::codifyName($modelName) . '_' . Helper::codifyName($fieldName);
        }
        $sql = 'ALTER TABLE ' . $tableName . ' DROP COLUMN ' . $fieldRealName;
        $statement = $database->getMasterLink()->prepare($sql);
        return $statement;
    }
public static function statement ( Database $ database , array $ schema , string $ modelName , string $ tableName , string $ fieldName ) { $ fieldDefinition = $ schema [ $ modelName ] [ 'fields' ] [ $ fieldName ] ; $ fieldRealName = null ; if ( isset ( $ fieldDefinition [ 'name' ] ) === true ) { $ fieldRealName = $ fieldDefinition [ 'name' ] ; } else { $ fieldRealName = Helper :: codifyName ( $ modelName ) . '_' . Helper :: codifyName ( $ fieldName ) ; } $ sql = 'ALTER TABLE ' . $ tableName . ' DROP COLUMN ' . $ fieldRealName ; $ statement = $ database -> getMasterLink ( ) -> prepare ( $ sql ) ; return $ statement ; }
Prepare and return according PDO statement.

@param  Database                $database        database
@param  array                   $schema          schema definition
@param  string                  $modelName       model name
@param  string                  $tableName       table name
@param  string                  $fieldName       field name
@return \PDOStatement           $statement       prepared query
Prepare and return according PDO statement .