db_add_primary_key

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/database.mysql-common.inc, строка 371

Версии
6
db_add_primary_key(&$ret, $table, $fields)

Добавляет первичный ключ.

Параметры

$ret Массив, в который будет добавлен результат запроса.

$table Имя изменяемой таблицы.

$fields Поля для первичного ключа.

Связанные темы

▾ 7 функции вызывают db_add_primary_key()

system_update_6001 in modules/system/system.install
Add version id column to {term_node} to allow taxonomy module to use revisions.
system_update_6002 in modules/system/system.install
Увеличивает наибольшую длинну имён переменных с 48 до 128.
system_update_6019 in modules/system/system.install
Reconcile small differences in the previous, manually created mysql and pgsql schemas so they are the same and can be represented by a single schema structure.
system_update_6022 in modules/system/system.install
Update files tables to associate files to a uid by default instead of a nid. Rename file_revisions to upload since it should only be used by the upload module used by upload to link files to nodes.
system_update_6033 in modules/system/system.install
Change node_comment_statistics to be not autoincrement.
system_update_6043 in modules/system/system.install
Update table indices to make them more rational and useful.
_db_create_keys in includes/database.pgsql.inc

Код

<?php
function db_add_primary_key(&$ret, $table, $fields) {
  $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.
    _db_create_key_sql($fields) .')');
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему