| 2 |
// $Id: advogato_import.install,v 1.1 2006/11/06 21:02:53 deekayen Exp $ |
// $Id: advogato_import.install,v 1.1 2006/11/06 21:02:53 deekayen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
|
* Implementation of hook_schema(). |
| 6 |
|
*/ |
| 7 |
|
function advogato_import_schema() { |
| 8 |
|
return array( |
| 9 |
|
'advogato_import' => array( |
| 10 |
|
'description' => t('Track Advogato usernames and which diary entries remaining to import.'), |
| 11 |
|
'fields' => array( |
| 12 |
|
'qid' => array( |
| 13 |
|
'type' => 'serial', |
| 14 |
|
'unsigned' => TRUE, |
| 15 |
|
'not null' => TRUE, |
| 16 |
|
'disp-width' => '10' |
| 17 |
|
), |
| 18 |
|
'uid' => array( |
| 19 |
|
'type' => 'int', |
| 20 |
|
'unsigned' => TRUE, |
| 21 |
|
'not null' => TRUE, |
| 22 |
|
'default' => 0, |
| 23 |
|
'disp-width' => '10' |
| 24 |
|
), |
| 25 |
|
'username' => array( |
| 26 |
|
'type' => 'varchar', |
| 27 |
|
'length' => '50', |
| 28 |
|
'not null' => TRUE, |
| 29 |
|
'default' => '' |
| 30 |
|
), |
| 31 |
|
'startentry' => array( |
| 32 |
|
'type' => 'int', |
| 33 |
|
'size' => 'medium', |
| 34 |
|
'not null' => TRUE, |
| 35 |
|
'default' => 0, |
| 36 |
|
'disp-width' => '5' |
| 37 |
|
), |
| 38 |
|
'endentry' => array( |
| 39 |
|
'type' => 'int', |
| 40 |
|
'size' => 'medium', |
| 41 |
|
'not null' => TRUE, |
| 42 |
|
'default' => 0, |
| 43 |
|
'disp-width' => '5' |
| 44 |
|
) |
| 45 |
|
), |
| 46 |
|
'primary key' => array('qid'), |
| 47 |
|
'indexes' => array( |
| 48 |
|
'uid' => array('uid') |
| 49 |
|
) |
| 50 |
|
) |
| 51 |
|
); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
/** |
| 55 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 56 |
*/ |
*/ |
| 57 |
function advogato_import_install() { |
function advogato_import_install() { |
| 58 |
switch ($GLOBALS['db_type']) { |
drupal_install_schema('advogato_import'); |
|
case 'mysql': |
|
|
case 'mysqli': |
|
|
db_query("CREATE TABLE {advogato_import} ( |
|
|
qid int(10) unsigned NOT NULL auto_increment, |
|
|
uid int(10) unsigned NOT NULL default '0', |
|
|
username varchar(50) NOT NULL default '', |
|
|
startentry mediumint(5) NOT NULL default '0', |
|
|
endentry mediumint(5) NOT NULL default '0', |
|
|
PRIMARY KEY (qid), |
|
|
KEY uid (uid))" |
|
|
); |
|
|
} |
|
| 59 |
} |
} |
| 60 |
|
|
| 61 |
/** |
/** |
| 62 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 63 |
*/ |
*/ |
| 64 |
function advogato_import_uninstall() { |
function advogato_import_uninstall() { |
| 65 |
switch ($GLOBALS['db_type']) { |
drupal_uninstall_schema('advogato_import'); |
|
case 'mysql': |
|
|
case 'mysqli': |
|
|
db_query("DROP TABLE {advogato_import}"); |
|
|
} |
|
| 66 |
variable_del('advogato_import_cron_limit'); |
variable_del('advogato_import_cron_limit'); |
| 67 |
variable_del('advogato_import_node_type'); |
variable_del('advogato_import_node_type'); |
| 68 |
variable_del('advogato_import_status'); |
variable_del('advogato_import_status'); |