~stefanor/drupal/sr

« back to all changes in this revision

Viewing changes to modules/xmlsitemap/xmlsitemap_term/xmlsitemap_term.install

  • Committer: Stefano Rivera
  • Date: 2009-02-03 13:46:19 UTC
  • Revision ID: stefano@rivera.za.net-20090203134619-qtah2mm7178s3gla
Updated:
* swfobject to 2.0 (jquery_media)
* path_redirect beta1
* xmlsitemap update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Id: xmlsitemap_term.install,v 1.5.2.12 2008/12/27 14:30:56 kiam Exp $
 
2
// $Id: xmlsitemap_term.install,v 1.5.2.14 2009/02/01 13:56:53 kiam Exp $
3
3
 
4
4
/*****************************************************************************
5
5
 * Drupal hooks.
17
17
        'type' => 'int',
18
18
        'unsigned' => TRUE,
19
19
      ),
20
 
      'last_changed' => array(
 
20
      'changed' => array(
21
21
        'description' => 'The Unix timestamp of the last change.',
22
22
        'type' => 'int',
23
23
      ),
51
51
 */
52
52
function xmlsitemap_term_update_6000() {
53
53
  $ret = array();
54
 
  $schema = xmlsitemap_term_schema();
55
54
  if (db_table_exists('xmlsitemap_term')) {
56
55
    if (db_column_exists('xmlsitemap_term', 'pid')) {
57
56
      $result = array();
61
60
      }
62
61
      db_drop_field($ret, 'xmlsitemap_term', 'pid');
63
62
    }
 
63
    if (db_column_exists('xmlsitemap_term', 'last_changed')) {
 
64
      db_change_field($ret, 'xmlsitemap_term', 'last_changed', 'changed',
 
65
        array(
 
66
          'description' => 'The Unix timestamp of the last change.',
 
67
          'type' => 'int',
 
68
        )
 
69
      );
 
70
    }
 
71
    if (!db_column_exists('xmlsitemap_term', 'changed')) {
 
72
      db_add_field($ret, 'xmlsitemap_term', 'changed',
 
73
        array(
 
74
          'description' => 'The Unix timestamp of the last change.',
 
75
          'type' => 'int',
 
76
        )
 
77
      );
 
78
    }
64
79
    $ret[] = update_sql("UPDATE {xmlsitemap_term}
65
80
      SET priority_override = -2.0
66
81
      WHERE priority_override IS NULL"
67
82
    );
68
83
    db_change_field($ret, 'xmlsitemap_term', 'priority_override', 'priority_override',
69
 
      $schema['xmlsitemap_term']['fields']['priority_override']
 
84
      array(
 
85
        'description' => 'The priority of the term in the site map.',
 
86
        'type' => 'float',
 
87
        'not null' => TRUE,
 
88
        'default' => -2.0,
 
89
      )
70
90
    );
71
91
  }
72
92
  else {
73
 
    db_create_table($ret, 'xmlsitemap_term', $schema['xmlsitemap_term']);
 
93
    db_create_table($ret, 'xmlsitemap_term',
 
94
      array(
 
95
        'description' => 'The base table for xmlsitemap_term.',
 
96
        'fields' => array(
 
97
          'tid' => array(
 
98
            'description' => 'The ID of the path.',
 
99
            'type' => 'int',
 
100
            'unsigned' => TRUE,
 
101
           ),
 
102
           'changed' => array(
 
103
             'description' => 'The Unix timestamp of the last change.',
 
104
             'type' => 'int',
 
105
           ),
 
106
           'previously_changed' => array(
 
107
             'description' => 'The Unix timestamp of the previous change.',
 
108
             'type' => 'int',
 
109
           ),
 
110
           'priority_override' => array(
 
111
             'description' => 'The priority of the term in the site map.',
 
112
             'type' => 'float',
 
113
             'not null' => TRUE,
 
114
             'default' => -2.0,
 
115
           ),
 
116
        ),
 
117
        'primary key' => array('tid'),
 
118
      )
 
119
    );
74
120
  }
75
121
  $ret[] = update_sql("UPDATE {system} SET weight = 7 WHERE name = 'xmlsitemap_term'");
76
122
  return $ret;
94
140
 * Implementation of hook_update_N().
95
141
 */
96
142
function xmlsitemap_term_update_6102() {
 
143
  return array();
 
144
}
 
145
 
 
146
/**
 
147
 * Implementation of hook_update_N().
 
148
 */
 
149
function xmlsitemap_term_update_6103() {
 
150
  return array();
 
151
}
 
152
 
 
153
/**
 
154
 * Implementation of hook_update_N().
 
155
 */
 
156
function xmlsitemap_term_update_6104() {
97
157
  return xmlsitemap_term_update_6000();
98
158
}
99
159