From b2f1372950eb23c86b9899365f8e8da981f8b4ff Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 27 Jun 2017 10:46:47 +1000 Subject: [PATCH] add schema update code --- booking.install | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/booking.install b/booking.install index bfbb36e..ab66583 100644 --- a/booking.install +++ b/booking.install @@ -625,6 +625,32 @@ function booking_update_7241() { _booking_node_create_mysqlview(); } + +/** +* Add support for early registration code +*/ +function booking_update_7242() { + //add field to booking_person table + $spec = array('type' => 'int', 'length' => '11', 'default' => 0, 'not null' => FALSE); + db_add_field('booking_person', 'booking_earlyaccess_code_id', $spec); + + //create new table to store the valid codes + $booking_regn_earlyaccess_codes = array( + 'fields' => array( + 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), + 'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), + 'booking_regn_earlyaccess_code' => array('type' => 'varchar', 'length' => '500', 'not null' => FALSE), + 'booking_regn_earlyaccess_code_avail' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE), + ), + 'primary key' => array('cid'), + ); + + db_create_table('booking_regn_earlyaccess_codes', $booking_regn_earlyaccess_codes); + + //update the view to match the new table definition + _booking_node_create_mysqlview(); +} + /** * Implementation of hook_install(). */