function _db_create_keys in Drupal 6
Related topics
2 calls to _db_create_keys()
- db_add_field in includes/
database.pgsql.inc - Add a new field to a table.
- db_change_field in includes/
database.pgsql.inc - Change a field definition.
File
- includes/
database.pgsql.inc, line 541 - Database interface code for PostgreSQL database servers.
Code
function _db_create_keys(&$ret, $table, $new_keys) {
if (isset($new_keys['primary key'])) {
db_add_primary_key($ret, $table, $new_keys['primary key']);
}
if (isset($new_keys['unique keys'])) {
foreach ($new_keys['unique keys'] as $name => $fields) {
db_add_unique_key($ret, $table, $name, $fields);
}
}
if (isset($new_keys['indexes'])) {
foreach ($new_keys['indexes'] as $name => $fields) {
db_add_index($ret, $table, $name, $fields);
}
}
}