You are here

function opigno_quiz_app_schema in Opigno Quiz App 7

Implements hook_schema().

File

./opigno_quiz_app.install, line 205
Defines module install logic.

Code

function opigno_quiz_app_schema() {
  return array(
    'opigno_quiz_app_quiz_sort' => array(
      'fields' => array(
        'gid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'quiz_nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'weight' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => '0',
        ),
      ),
      'indexes' => array(
        'group_id' => array(
          'gid',
        ),
        'quiz_id' => array(
          'quiz_nid',
        ),
      ),
    ),
    'opigno_quiz_app_course_latest_viewed' => array(
      'fields' => array(
        'course_nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'quiz_nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'uid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'unsigned' => TRUE,
        ),
        'result_id' => array(
          'type' => 'int',
          'not null' => TRUE,
          'unsigned' => TRUE,
        ),
      ),
      'primary key' => array(
        'course_nid',
        'uid',
      ),
    ),
  );
}