You are here

function multiple_registration_update_8202 in Multiple Registration 3.x

Same name and namespace in other branches
  1. 8.2 multiple_registration.install \multiple_registration_update_8202()

Create database schema to store the correspondent rid for each user.

File

./multiple_registration.install, line 69
multiple_registration.install

Code

function multiple_registration_update_8202() {
  $spec = [
    'description' => 'Stores the correspondent rid for each user.',
    'fields' => [
      'uid' => [
        'description' => 'The User ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'rid' => [
        'description' => 'The identifier of the multiple_registration page definition.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ],
    ],
    'foreign keys' => [
      'uid' => [
        'users' => 'uid',
      ],
    ],
  ];
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->createTable('multiple_registration', $spec);
}