From 44b01f01b4977d4816ee1dc5c4cf4fcf322d2dec Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 24 Apr 2012 19:30:37 -0300 Subject: More refactoring --- reminder.install | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'reminder.install') diff --git a/reminder.install b/reminder.install index 38de02f..a5bbbb0 100644 --- a/reminder.install +++ b/reminder.install @@ -41,7 +41,7 @@ function reminder_schema() { 'not null' => TRUE, 'default' => '0' ), - 'interval' => array( + 'frequency' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, @@ -167,3 +167,25 @@ function reminder_update_7000(&$sandbox) { $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' + ) + ); +} -- cgit v1.2.3