Project

General

Profile

« Previous | Next » 

Revision 972696a2

Added by Andreas Kohlbecker about 14 years ago

updating module infos & improved uninstall update for cdm_api

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.install
15 15
    PRIMARY KEY (cid),
16 16
    INDEX expire (expire)
17 17
    ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
18
  
19
  db_query("
18
    
19
  db_query(_get_sql_create_nodecdm());
20
  db_query(_get_sql_fix_watchdog());
21
}
22

  
23
/**
24
 * Implementation of hook_uninstall().
25
 */
26
function cdm_api_uninstall(){
27
    db_query("DROP TABLE {cache_cdm_ws};");
28
    //TODO delete all cdm nodes using node_delete()    
29
    db_query("DROP TABLE {node_cdm};");
30

  
31
}
32

  
33
/**
34
 * Implementation of hook_api_update_N().
35
 * 
36
 * Update 1 for version 5.x-1.0
37
 */
38
function cdm_api_update_5101() {
39
  $items = array();
40
  $items[] = update_sql(_get_sql_create_nodecdm());
41
  $items[] = update_sql(_get_sql_fix_watchdog());
42
  return $items;
43
}
44

  
45
// ------------------------- SQL  Scripts ------------------------ // 
46

  
47
function _get_sql_create_nodecdm() {
48
  return "
20 49
    CREATE TABLE {node_cdm} (
21 50
      `nid` int(11) NOT NULL,
22 51
      `wsuri` varchar(255) default NULL,
......
24 53
      `uuid` varchar(255) default NULL,
25 54
      PRIMARY KEY  (`uuid`)
26 55
    ) /*!40100 DEFAULT CHARACTER SET UTF8 */  
27
    ");
28
  
56
    ";
29 57
}
30 58

  
31
/**
32
 * Implementation of hook_uninstall().
33
 */
34
function cdm_api_uninstall(){
35
    db_query("DROP TABLE {cache_cdm_ws};");
36
}
37
 ?>
59
function _get_sql_fix_watchdog() {
60
  return  "ALTER TABLE {watchdog} CHANGE referer referer TEXT NOT NULL ;";
61
}

Also available in: Unified diff