| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: ecard.install,v 1.1.4.4 2009/02/13 19:04:17 karst Exp $
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* Install file for the ecard module
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* hook_install.
|
| 12 |
*/
|
| 13 |
|
| 14 |
function ecard_install() {
|
| 15 |
drupal_install_schema('ecard');
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* schema definition
|
| 20 |
**/
|
| 21 |
function ecard_schema() {
|
| 22 |
$schema['ecard'] = array(
|
| 23 |
'fields' => array(
|
| 24 |
'random' => array(
|
| 25 |
'type' => 'varchar' ,
|
| 26 |
'not null' => TRUE,
|
| 27 |
'default' => '',
|
| 28 |
'length' => '64'
|
| 29 |
),
|
| 30 |
'nid' => array(
|
| 31 |
'type' => 'int',
|
| 32 |
'unsigned' => TRUE,
|
| 33 |
'not null' => TRUE,
|
| 34 |
'length' => '10'
|
| 35 |
),
|
| 36 |
'sender_name' => array(
|
| 37 |
'type' => 'varchar',
|
| 38 |
'not null' => TRUE,
|
| 39 |
'length' => '128'
|
| 40 |
),
|
| 41 |
'sender_email' => array(
|
| 42 |
'type' => 'varchar',
|
| 43 |
'not null' => TRUE,
|
| 44 |
'length' => '128'
|
| 45 |
),
|
| 46 |
'recp_mail' => array(
|
| 47 |
'type' => 'varchar',
|
| 48 |
'not null' => TRUE,
|
| 49 |
'length' => '128'
|
| 50 |
),
|
| 51 |
'message' => array(
|
| 52 |
'type' => 'text',
|
| 53 |
'not null' => TRUE
|
| 54 |
),
|
| 55 |
'send_time' => array(
|
| 56 |
'type' => 'int',
|
| 57 |
'not null' => TRUE,
|
| 58 |
'length' => '10'
|
| 59 |
),
|
| 60 |
'send' => array(
|
| 61 |
'type' => 'varchar',
|
| 62 |
'not null' => TRUE,
|
| 63 |
'length' => '10'
|
| 64 |
),
|
| 65 |
'notify' => array(
|
| 66 |
'type' => 'varchar',
|
| 67 |
'not null' => TRUE,
|
| 68 |
'length' => '10'
|
| 69 |
),
|
| 70 |
'format' => array(
|
| 71 |
'type' => 'int',
|
| 72 |
'not null' => TRUE,
|
| 73 |
'length' => '6'
|
| 74 |
)
|
| 75 |
),
|
| 76 |
'primary key' => array('random'),
|
| 77 |
);
|
| 78 |
return $schema;
|
| 79 |
}
|
| 80 |
|
| 81 |
/**
|
| 82 |
* Implementation of hook_uninstall().
|
| 83 |
*/
|
| 84 |
function ecard_uninstall() {
|
| 85 |
drupal_uninstall_schema('ecard');
|
| 86 |
}
|
| 87 |
|
| 88 |
/**
|
| 89 |
* Implementation of hook_update().
|
| 90 |
*/
|
| 91 |
function ecard_update_6001() {
|
| 92 |
$ret = array();
|
| 93 |
$ret[] = update_sql("ALTER TABLE {ecard} ADD format int(6) NOT NULL default 0");
|
| 94 |
return $ret;
|
| 95 |
}
|