From bad1954caba469166a15e534e82bf7739f932fe7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 23 Apr 2012 23:22:19 -0300 Subject: Start refactoring --- reminder.install | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'reminder.install') diff --git a/reminder.install b/reminder.install index d958832..38de02f 100644 --- a/reminder.install +++ b/reminder.install @@ -127,5 +127,43 @@ function reminder_schema() { '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']); +} -- cgit v1.2.3