59
59
function xmlsitemap_file_update_6000() {
61
$schema = xmlsitemap_file_schema();
62
if (!db_table_exists('xmlsitemap_file')) {
63
db_create_table($ret, 'xmlsitemap_file', $schema['xmlsitemap_file']);
61
if (db_table_exists('xmlsitemap_file')) {
67
63
@db_drop_primary_key($result, 'xmlsitemap_file');
68
64
if ($result[0]['success']) {
74
70
$ret[] = $result[0];
76
72
db_change_field($ret, 'xmlsitemap_file', 'fid', 'fid',
77
$schema['xmlsitemap_file']['fields']['nid'],
78
array('primary keys' => array('fid'))
74
'description' => 'The ID of the file.',
80
array('primary key' => array('fid'))
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',
85
'description' => 'The ID of the node containing the file.',
91
array('unique keys' => array('fid_nid' => array('fid', 'nid')))
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')))
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')))
97
'description' => 'The ID of the node containing the file.',
103
array('unique keys' => array('fid_nid' => array('fid', 'nid')))
106
if (db_column_exists('xmlsitemap_file', 'last_changed')) {
107
db_change_field($ret, 'xmlsitemap_file', 'last_changed', 'changed',
109
'description' => 'The Unix timestamp of the last change.',
114
if (!db_column_exists('xmlsitemap_file', 'changed')) {
115
db_add_field($ret, 'xmlsitemap_file', 'changed',
117
'description' => 'The Unix timestamp of the last change.',
92
122
$result = update_sql("DELETE FROM {xmlsitemap_file} WHERE nid = 0");
128
db_create_table($ret, 'xmlsitemap_file',
130
'description' => 'The base table for xmlsitemap_file.',
133
'description' => 'The ID of the file.',
140
'description' => 'The ID of the node containing the file.',
147
'description' => 'The change time of the file.',
150
'previously_changed' => array(
151
'description' => 'The previous change time of the file.',
155
'unique keys' => array('fid_nid' => array('fid', 'nid')),
156
'primary keys' => array('fid'),
97
160
$ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'xmlsitemap_file'");
130
193
* Implementation of hook_update_N().
132
195
function xmlsitemap_file_update_6104() {
200
* Implementation of hook_update_N().
202
function xmlsitemap_file_update_6105() {
207
* Implementation of hook_update_N().
209
function xmlsitemap_file_update_6106() {
214
* Implementation of hook_update_N().
216
function xmlsitemap_file_update_6107() {
133
217
return xmlsitemap_file_update_6000();