You are here

function rooms_unit_update_7009 in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Adds status and uid properties to Bookable units.

File

modules/rooms_unit/rooms_unit.install, line 595
Sets up the base table for our entity and a table to store information about the entity types.

Code

function rooms_unit_update_7009() {
  db_add_field('rooms_units', 'status', array(
    'description' => 'Boolean indicating whether the booking unit is published (visible to non-administrators).',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 1,
  ));
  db_add_field('rooms_units', 'uid', array(
    'description' => 'The {users}.uid that created this booking.',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
  ));

  // Set all the units published and owned by admin user.
  db_update('rooms_units')
    ->fields(array(
    'status' => 1,
    'uid' => 1,
  ))
    ->execute();
  return t('New columns added to rooms_units table');
}