You are here

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

Create customers table.

File

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

Code

function rooms_booking_update_7002() {
  $schema['rooms_customers'] = array(
    'description' => 'Stores information about customers.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique customer identifier.',
      ),
      'name' => array(
        'description' => 'Customer\'s name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'commerce_customer_id' => array(
        'type' => 'int',
        'not null' => FALSE,
        'description' => 'Commerce customer id.',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'type' => array(
        'name',
      ),
    ),
  );
  db_create_table('rooms_customers', $schema['rooms_customers']);
}