Function Database_Static_postgresql->change_primary_key__sql

Definitions

sources/database/postgresql.php

  • Get SQL for changing the primary key of a table.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$table_prefix string No No required parameter N/A N/A The table prefix
$table_name ID_TEXT No No required parameter N/A N/A The name of the table to create the index on
$new_key array No No required parameter N/A N/A A list of fields to put in the new key

Returns

  • List of SQL queries to run
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get SQL for changing the primary key of a table.
 *
 * @param  string $table_prefix The table prefix
 * @param  ID_TEXT $table_name The name of the table to create the index on
 * @param  array $new_key A list of fields to put in the new key
 * @return array List of SQL queries to run
 */

public function change_primary_key__sql(string $table_prefix, string $table_name, array $new_key) : array