'The main informations of the reminders.', 'fields' => array( 'nid' => array( 'description' => 'The contact with the base node.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE ), 'uid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0 ), 'anonym_name' => array( 'type' => 'varchar', 'length' => 100, 'default' => '' ), 'anonym_email' => array( 'type' => 'varchar', 'length' => 100, 'default' => '' ), 'until' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0' ), 'frequency' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0' ), 'url' => array( 'type' => 'varchar', 'length' => 10, 'not null' => TRUE, 'default' => '' ), 'admin_url' => array( 'type' => 'varchar', 'length' => 25, 'not null' => TRUE, 'default' => '' ), 'secure' => array( 'type' => 'int', 'not null' => TRUE, 'default' => '0' ), 'description' => array( 'description' => t('Reminder description'), 'type' => 'text', 'length' => 5000, ), ), 'primary key' => array('nid'), ); $schema['reminder_subscriptions'] = array( 'description' => 'The table of subscribed users.', 'fields' => array( 'id' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE ), 'email' => array( 'type' => 'varchar', 'length' => 100, 'default' => '' ), 'reminder_id' => array( 'type' => 'int', 'not null' => TRUE, 'unsigned' => TRUE, 'default' => 0 ), 'unsubscribe_url' => array( 'type' => 'varchar', 'length' => 30, 'not null' => TRUE, 'default' => '' ), ), 'primary key' => array('id'), ); $schema['reminder_logs'] = array( 'description' => 'Log table.', 'fields' => array( 'log_id' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE ), 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0 ), 'username' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'dt' => array( 'type' => 'int', 'not null' => TRUE, ), ), 'primary key' => array('log_id'), ); $schema['reminder_notifications'] = array( 'description' => 'The table of sent notifications.', 'fields' => array( 'id' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE ), 'reminder_id' => array( 'type' => 'int', 'not null' => TRUE, 'unsigned' => TRUE, 'default' => 0 ), 'last' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0' ), ), 'primary key' => array('id'), ); return $schema; } /** * Adds notification table. */ function reminder_update_7000(&$sandbox) { // Make sure to not run this update twice. if (db_table_exists('reminder_notifications')) { return; } $schema = reminder_schema(); db_create_table('reminder_notifications', $schema['reminder_notifications']); } /** * Change field 'interval' to 'frequency'. */ function reminder_update_7001(&$sandbox) { // Make sure to not run this update twice. if (db_field_exists('reminder', 'frequency')) { return; } db_drop_field('reminder', 'interval'); db_add_field('reminder', 'frequency', array( 'description' => t('Reminder frequency.'), 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0' ) ); } /** * Adds description field. */ function reminder_update_7002(&$sandbox) { db_add_field('reminder', 'description', array( 'description' => t('Reminder description'), 'type' => 'text', 'length' => 5000, ) ); } /** * Increase unsubscribe_url size. */ function reminder_update_7003(&$sandbox) { db_change_field('reminder_subscriptions', 'unsubscribe_url', 'unsubscribe_url', array( 'type' => 'varchar', 'length' => 30, 'not null' => TRUE, 'default' => '' ) ); }