| 1 |
<?php
|
| 2 |
// $Id: autosave.install,v 1.2.2.7 2008/09/12 13:37:55 ptalindstrom Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_enable().
|
| 6 |
*/
|
| 7 |
function autosave_enable() {
|
| 8 |
drupal_set_message(t('Autosave module successfully installed. Please review the <a href="@settings">configuration settings</a>.', array('@settings' => url('admin/settings/autosave'))));
|
| 9 |
}
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Implementation of hook_install().
|
| 13 |
*/
|
| 14 |
function autosave_install() {
|
| 15 |
drupal_install_schema('autosave');
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_uninstall().
|
| 20 |
*/
|
| 21 |
function autosave_uninstall() {
|
| 22 |
drupal_uninstall_schema('autosave');
|
| 23 |
}
|
| 24 |
|
| 25 |
/**
|
| 26 |
* Implementation of hook_schema()
|
| 27 |
*/
|
| 28 |
function autosave_schema() {
|
| 29 |
return array(
|
| 30 |
'autosaved_forms' => array(
|
| 31 |
'description' => t("Table to save forms in the database"),
|
| 32 |
'fields' => array(
|
| 33 |
'form_id' => array(
|
| 34 |
'type' => 'varchar',
|
| 35 |
'length' => 64,
|
| 36 |
'not null' => TRUE,
|
| 37 |
),
|
| 38 |
'path' => array(
|
| 39 |
'type' => 'varchar',
|
| 40 |
'length' => 255,
|
| 41 |
'not null' => TRUE,
|
| 42 |
),
|
| 43 |
'uid' => array(
|
| 44 |
'type' => 'int',
|
| 45 |
'length' => 11,
|
| 46 |
'not null' => TRUE,
|
| 47 |
'default' => 0,
|
| 48 |
),
|
| 49 |
'timestamp' => array(
|
| 50 |
'type' => 'int',
|
| 51 |
'length' => 11,
|
| 52 |
'not null' => TRUE,
|
| 53 |
'default' => 0,
|
| 54 |
),
|
| 55 |
'serialized' => array(
|
| 56 |
'type' => 'text',
|
| 57 |
'not null' => TRUE,
|
| 58 |
'size' => 'big',
|
| 59 |
),
|
| 60 |
),
|
| 61 |
'primary key' => array('form_id', 'path', 'uid'),
|
| 62 |
),
|
| 63 |
);
|
| 64 |
}
|