Migrations\View\Helper\MigrationHelper::hasUnsignedPrimaryKey PHP Method

hasUnsignedPrimaryKey() public method

Returns whether the $tables list given as arguments contains primary keys unsigned.
public hasUnsignedPrimaryKey ( array $tables ) : boolean
$tables array List of tables to check
return boolean
    public function hasUnsignedPrimaryKey($tables)
    {
        foreach ($tables as $table) {
            $tableSchema = $table;
            if (!$table instanceof Table) {
                $tableSchema = $this->schema($table);
            }
            $tablePrimaryKeys = $tableSchema->primaryKey();
            foreach ($tablePrimaryKeys as $primaryKey) {
                $column = $tableSchema->column($primaryKey);
                if (isset($column['unsigned']) && $column['unsigned'] === true) {
                    return true;
                }
            }
        }
        return false;
    }