add node id to earlyaccess codes table
This commit is contained in:
@@ -673,6 +673,7 @@ function booking_update_7244() {
|
|||||||
'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_earlyaccess_code' => array('type' => 'varchar', 'length' => '500', 'not null' => FALSE),
|
'booking_earlyaccess_code' => array('type' => 'varchar', 'length' => '500', 'not null' => FALSE),
|
||||||
'booking_earlyaccess_code_avail' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_earlyaccess_code_avail' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
|
'booking_earlyaccess_code_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
),
|
),
|
||||||
'primary key' => array('cid'),
|
'primary key' => array('cid'),
|
||||||
);
|
);
|
||||||
@@ -693,6 +694,15 @@ function booking_update_7245() {
|
|||||||
_booking_node_create_mysqlview();
|
_booking_node_create_mysqlview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add node id to booking_earlyaccess_codes table
|
||||||
|
*/
|
||||||
|
function booking_update_7246() {
|
||||||
|
$spec = array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10');
|
||||||
|
db_add_field('booking_earlyaccess_codes', 'booking_earlyaccess_code_nid', $spec);
|
||||||
|
//update the view to match the new table definition
|
||||||
|
_booking_node_create_mysqlview();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1086,6 +1096,7 @@ function booking_schema() {
|
|||||||
'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_earlyaccess_code' => array('type' => 'varchar', 'length' => '500', 'not null' => FALSE),
|
'booking_earlyaccess_code' => array('type' => 'varchar', 'length' => '500', 'not null' => FALSE),
|
||||||
'booking_earlyaccess_code_avail' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_earlyaccess_code_avail' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
|
'booking_earlyaccess_code_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
),
|
),
|
||||||
'primary key' => array('cid'),
|
'primary key' => array('cid'),
|
||||||
);
|
);
|
||||||
|
@@ -1308,7 +1308,8 @@ function _booking_form_submit_post_triggers($node)
|
|||||||
|
|
||||||
//update the database to mark the code as being unavailable
|
//update the database to mark the code as being unavailable
|
||||||
db_update('booking_earlyaccess_codes')->fields(array(
|
db_update('booking_earlyaccess_codes')->fields(array(
|
||||||
'booking_earlyaccess_code_avail' => 'N'
|
'booking_earlyaccess_code_avail' => 'N',
|
||||||
|
'booking_earlyaccess_code_nid' => $node->nid,
|
||||||
))->condition('cid', $node->booking_earlyaccess_code_id)->execute();
|
))->condition('cid', $node->booking_earlyaccess_code_id)->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user