| 1 |
<?php
|
| 2 |
// $Id: postalso.install,v 1.1 2008/11/03 18:55:36 yi Exp $
|
| 3 |
|
| 4 |
function postalso_install() {
|
| 5 |
// Create my tables.
|
| 6 |
drupal_install_schema('postalso');
|
| 7 |
}
|
| 8 |
|
| 9 |
function postalso_uninstall() {
|
| 10 |
// Drop my tables.
|
| 11 |
drupal_uninstall_schema('postalso');
|
| 12 |
db_query("DELETE FROM {variable} WHERE name LIKE 'postalso_%'");
|
| 13 |
cache_clear_all('variables', 'cache');
|
| 14 |
}
|
| 15 |
|
| 16 |
function postalso_schema() {
|
| 17 |
$schema['postalso_history'] = array(
|
| 18 |
'description' => t('The table to hold the postalso history.'),
|
| 19 |
'fields' => array(
|
| 20 |
'pid' => array(
|
| 21 |
'description' => t('The auto-increment key of postalso'),
|
| 22 |
'type' => 'serial',
|
| 23 |
'unsigned' => TRUE,
|
| 24 |
'not null' => TRUE,
|
| 25 |
),
|
| 26 |
'dst_url' => array(
|
| 27 |
'description' => t('Destination url.'),
|
| 28 |
'type' => 'varchar',
|
| 29 |
'length' => 256,
|
| 30 |
'not null' => TRUE,
|
| 31 |
'default' => '',
|
| 32 |
),
|
| 33 |
'nid_src' => array(
|
| 34 |
'description' => t('Node id in the source site.'),
|
| 35 |
'type' => 'int',
|
| 36 |
'unsigned' => TRUE,
|
| 37 |
'not null' => TRUE,
|
| 38 |
),
|
| 39 |
'nid_dst' => array(
|
| 40 |
'description' => t('Node id in the destination site.'),
|
| 41 |
'type' => 'int',
|
| 42 |
'unsigned' => TRUE,
|
| 43 |
'not null' => TRUE,
|
| 44 |
),
|
| 45 |
'time' => array(
|
| 46 |
'description' => t('The time of posting to the other site.'),
|
| 47 |
'type' => 'datetime',
|
| 48 |
'not null' => TRUE,
|
| 49 |
),
|
| 50 |
),
|
| 51 |
'indexes' => array(
|
| 52 |
'postalso_dst_url' => array('dst_url'),
|
| 53 |
'postalso_nid_src' => array('nid_src'),
|
| 54 |
'postalso_nid_dst' => array('nid_dst'),
|
| 55 |
'postalso_time' => array('time'),
|
| 56 |
),
|
| 57 |
'primary key' => array('pid'),
|
| 58 |
);
|
| 59 |
return $schema;
|
| 60 |
}
|
| 61 |
|