RSS

(root)/drupal/7-fic : 14.1.14 : includes/database/pgsql/schema.inc

« back to all changes in this revision

Viewing changes to includes/database/pgsql/schema.inc

bzr
2008-12-20 19:00:05
This revision was merged to the branch mainline in revision 316.
Revision ID: bzr@web3.fourkitchens.com-20081220190005-uq28yg3zmtg98v4w
Scheduled update from HEAD: Sat Dec 20 19:00:05 GMT 2008

Show diffs side-by-side

added added

removed removed

1
1
<?php
2
 
// $Id: schema.inc,v 1.3 2008/11/26 13:42:25 dries Exp $
 
2
// $Id: schema.inc,v 1.4 2008/12/20 18:24:34 dries Exp $
3
3
 
4
4
/**
5
5
 * @file
137
137
   * to the engine-specific data type.
138
138
   */
139
139
  function getFieldTypeMap() {
140
 
    // Put :normal last so it gets preserved by array_flip.  This makes
 
140
    // Put :normal last so it gets preserved by array_flip. This makes
141
141
    // it much easier for modules (such as schema.module) to map
142
142
    // database types back into schema types.
143
143
    $map = array(
235
235
   * @param $keys_new
236
236
   *   Optional keys and indexes specification to be created on the
237
237
   *   table along with adding the field. The format is the same as a
238
 
   *   table specification but without the 'fields' element.  If you are
 
238
   *   table specification but without the 'fields' element. If you are
239
239
   *   adding a type 'serial' field, you MUST specify at least one key
240
240
   *   or index including it in this array. @see db_change_field for more
241
241
   *   explanation why.
424
424
   * );
425
425
   * @endcode
426
426
   * and you want to change foo.bar to be type serial, leaving it as the
427
 
   * primary key.  The correct sequence is:
 
427
   * primary key. The correct sequence is:
428
428
   * @code
429
429
   * db_drop_primary_key($ret, 'foo');
430
430
   * db_change_field($ret, 'foo', 'bar', 'bar',
439
439
   * sequences (from serial-type fields) that use the changed field to be dropped.
440
440
   *
441
441
   * On MySQL, all type 'serial' fields must be part of at least one key
442
 
   * or index as soon as they are created.  You cannot use
 
442
   * or index as soon as they are created. You cannot use
443
443
   * db_add_{primary_key,unique_key,index}() for this purpose because
444
444
   * the ALTER TABLE command will fail to add the column without a key
445
 
   * or index specification.  The solution is to use the optional
 
445
   * or index specification. The solution is to use the optional
446
446
   * $new_keys argument to create the key or index at the same time as
447
447
   * field.
448
448
   *

Loggerhead 1.17 is a web-based interface for Bazaar branches