/[drupal]/contributions/modules/photos/photos.install
ViewVC logotype

Diff of /contributions/modules/photos/photos.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5 by eastcn, Fri Mar 6 08:18:44 2009 UTC revision 1.1.2.6 by eastcn, Wed Mar 11 02:38:31 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: photos.install,v 1.1.2.4 2008/09/10 03:08:38 eastcn Exp $  // $Id: photos.install,v 1.1.2.5 2009/03/06 08:18:44 eastcn Exp $
3  function photos_schema() {  function photos_schema() {
4    $schema['x_album'] = array(    $schema['x_album'] = array(
5      'fields' => array(      'fields' => array(
6          'pid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),          'pid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
7          'fid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),          'fid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
8        'count'    => array('type' => 'int', 'not null' => TRUE),        'count'    => array('type' => 'int', 'not null' => TRUE),
9        'data'    => array('type' => 'text', 'default' => '', 'size' => 'big')        'data'    => array('type' => 'text', 'not null' => TRUE, 'size' => 'big')
10      ),      ),
11      'indexes' => array(      'indexes' => array(
12          'fid' => array('fid'),          'fid' => array('fid'),
# Line 18  function photos_schema() { Line 18  function photos_schema() {
18      'fields' => array(      'fields' => array(
19          'fid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),          'fid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
20          'pid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),          'pid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
21          'des'    => array('type' => 'text', 'not null' => TRUE,'size' => 'big'),          'des'    => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
22          'wid'    => array('type' => 'int', 'size' => 'tiny', 'length' => 4, 'not null' => TRUE),          'wid'    => array('type' => 'int', 'size' => 'tiny', 'length' => 4, 'not null' => TRUE),
23          'count'    => array('type' => 'int', 'not null' => TRUE),          'count'    => array('type' => 'int', 'not null' => TRUE),
24        'comcount'    => array('type' => 'int', 'not null' => TRUE),        'comcount'    => array('type' => 'int', 'not null' => TRUE),
# Line 143  function photos_update_3() { Line 143  function photos_update_3() {
143    db_drop_index($ret, 'x_album', 'uid');    db_drop_index($ret, 'x_album', 'uid');
144    db_change_field($ret, 'x_album', 'uid', 'count', array('type' => 'int', 'not null' => TRUE));    db_change_field($ret, 'x_album', 'uid', 'count', array('type' => 'int', 'not null' => TRUE));
145    db_add_index($ret, 'x_album', 'count', array('count'));    db_add_index($ret, 'x_album', 'count', array('count'));
146    db_add_field($ret, 'x_album', 'data', array('type' => 'text', 'default' => '', 'size' => 'big'));    db_add_field($ret, 'x_album', 'data', array('type' => 'text', 'not null' => TRUE, 'size' => 'big'));
147    $result = db_query('SELECT pid FROM {x_album} ORDER BY pid ASC');    $result = db_query('SELECT pid FROM {x_album} ORDER BY pid ASC');
148    while($image = db_fetch_object($result)){    while($image = db_fetch_object($result)){
149      db_query('UPDATE {x_album} SET count = (SELECT count(pid) FROM {x_image} WHERE pid = %d) WHERE pid = %d', $image->pid, $image->pid);      db_query('UPDATE {x_album} SET count = (SELECT count(pid) FROM {x_image} WHERE pid = %d) WHERE pid = %d', $image->pid, $image->pid);

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.3