add schema update code

This commit is contained in:
2017-06-27 10:46:47 +10:00
parent 3d588081ee
commit b2f1372950

View File

@@ -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().
*/