~stefanor/drupal/sr

« back to all changes in this revision

Viewing changes to modules/xmlsitemap/xmlsitemap_file/xmlsitemap_file.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_file.install,v 1.1.4.17 2008/12/26 10:33:55 kiam Exp $
 
2
// $Id: xmlsitemap_file.install,v 1.1.4.21 2009/02/02 21:36:21 kiam Exp $
3
3
 
4
4
/**
5
5
 * @file
58
58
 */
59
59
function xmlsitemap_file_update_6000() {
60
60
  $ret = array();
61
 
  $schema = xmlsitemap_file_schema();
62
 
  if (!db_table_exists('xmlsitemap_file')) {
63
 
    db_create_table($ret, 'xmlsitemap_file', $schema['xmlsitemap_file']);
64
 
  }
65
 
  else {
 
61
  if (db_table_exists('xmlsitemap_file')) {
66
62
    $result = array();
67
63
    @db_drop_primary_key($result, 'xmlsitemap_file');
68
64
    if ($result[0]['success']) {
74
70
      $ret[] = $result[0];
75
71
    }
76
72
    db_change_field($ret, 'xmlsitemap_file', 'fid', 'fid',
77
 
      $schema['xmlsitemap_file']['fields']['nid'],
78
 
      array('primary keys' => array('fid'))
 
73
      array(
 
74
        'description' => 'The ID of the file.',
 
75
        'type' => 'int',
 
76
        'unsigned' => TRUE,
 
77
        'not null' => TRUE,
 
78
        'default' => 0,
 
79
      ),
 
80
      array('primary key' => array('fid'))
79
81
    );
80
 
    if (!db_column_exists('xmlsitemap_file', 'nid')) {
 
82
    if (db_column_exists('xmlsitemap_file', 'nid')) {
 
83
      db_change_field($ret, 'xmlsitemap_file', 'nid', 'nid',
 
84
        array(
 
85
          'description' => 'The ID of the node containing the file.',
 
86
          'type' => 'int',
 
87
          'unsigned' => TRUE,
 
88
          'not null' => TRUE,
 
89
          'default' => 0,
 
90
        ),
 
91
        array('unique keys' => array('fid_nid' => array('fid', 'nid')))
 
92
      );
 
93
    }
 
94
    else {
81
95
      db_add_field($ret, 'xmlsitemap_file', 'nid',
82
 
        $schema['xmlsitemap_file']['fields']['nid'],
83
 
        array('unique keys' => array('fid_nid' => array('fid', 'nid')))
84
 
      );
85
 
    }
86
 
    else {
87
 
      db_change_field($ret, 'xmlsitemap_file', 'nid', 'nid',
88
 
        $schema['xmlsitemap_file']['fields']['nid'],
89
 
        array('unique keys' => array('fid_nid' => array('fid', 'nid')))
 
96
        array(
 
97
          'description' => 'The ID of the node containing the file.',
 
98
          'type' => 'int',
 
99
          'unsigned' => TRUE,
 
100
          'not null' => TRUE,
 
101
          'default' => 0,
 
102
        ),
 
103
        array('unique keys' => array('fid_nid' => array('fid', 'nid')))
 
104
      );
 
105
    }
 
106
    if (db_column_exists('xmlsitemap_file', 'last_changed')) {
 
107
      db_change_field($ret, 'xmlsitemap_file', 'last_changed', 'changed',
 
108
        array(
 
109
          'description' => 'The Unix timestamp of the last change.',
 
110
          'type' => 'int',
 
111
        )
 
112
      );
 
113
    }
 
114
    if (!db_column_exists('xmlsitemap_file', 'changed')) {
 
115
      db_add_field($ret, 'xmlsitemap_file', 'changed',
 
116
        array(
 
117
          'description' => 'The Unix timestamp of the last change.',
 
118
          'type' => 'int',
 
119
        )
90
120
      );
91
121
    }
92
122
    $result = update_sql("DELETE FROM {xmlsitemap_file} WHERE nid = 0");
94
124
      $ret[] = $result;
95
125
    }
96
126
  }
 
127
  else {
 
128
    db_create_table($ret, 'xmlsitemap_file',
 
129
      array(
 
130
        'description' => 'The base table for xmlsitemap_file.',
 
131
        'fields' => array(
 
132
          'fid' => array(
 
133
            'description' => 'The ID of the file.',
 
134
            'type' => 'int',
 
135
            'unsigned' => TRUE,
 
136
            'not null' => TRUE,
 
137
            'default' => 0,
 
138
          ),
 
139
          'nid' => array(
 
140
            'description' => 'The ID of the node containing the file.',
 
141
            'type' => 'int',
 
142
            'unsigned' => TRUE,
 
143
            'not null' => TRUE,
 
144
            'default' => 0,
 
145
          ),
 
146
          'changed' => array(
 
147
            'description' => 'The change time of the file.',
 
148
            'type' => 'int',
 
149
          ),
 
150
          'previously_changed' => array(
 
151
            'description' => 'The previous change time of the file.',
 
152
            'type' => 'int',
 
153
          ),
 
154
        ),
 
155
        'unique keys' => array('fid_nid' => array('fid', 'nid')),
 
156
        'primary keys' => array('fid'),
 
157
      )
 
158
    );
 
159
  }
97
160
  $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'xmlsitemap_file'");
98
161
  return $ret;
99
162
}
130
193
 * Implementation of hook_update_N().
131
194
 */
132
195
function xmlsitemap_file_update_6104() {
 
196
  return array();
 
197
}
 
198
 
 
199
/**
 
200
 * Implementation of hook_update_N().
 
201
 */
 
202
function xmlsitemap_file_update_6105() {
 
203
  return array();
 
204
}
 
205
 
 
206
/**
 
207
 * Implementation of hook_update_N().
 
208
 */
 
209
function xmlsitemap_file_update_6106() {
 
210
  return array();
 
211
}
 
212
 
 
213
/**
 
214
 * Implementation of hook_update_N().
 
215
 */
 
216
function xmlsitemap_file_update_6107() {
133
217
  return xmlsitemap_file_update_6000();
134
218
}
135
219