function certificate_schema in Certificate 6.2
Same name and namespace in other branches
- 8.3 certificate.install \certificate_schema()
- 6 certificate.install \certificate_schema()
- 7.3 certificate.install \certificate_schema()
- 7.2 certificate.install \certificate_schema()
- 3.x certificate.install \certificate_schema()
Implementation of hook_schema().
File
- ./
certificate.install, line 11 - Install the Certificate module.
Code
function certificate_schema() {
$schema['certificate_node_settings'] = array(
'description' => 'Stores per-node template settings.',
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'orientation' => array(
'type' => 'varchar',
'length' => 255,
),
),
'primary key' => array(
'nid',
),
);
$schema['certificate_node'] = array(
'description' => t('Stores per-node certificate settings.'),
'fields' => array(
'cnid' => array(
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
'description' => 'Unique identifier for the per-node / per-type template setting.',
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => 'Course node ID.',
),
'mapper' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'The mapper to use.',
),
'type' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'The value to match on.',
),
'template' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => 'The certificate node ID to deliver on a match.',
),
),
'primary key' => array(
'cnid',
),
);
$schema['certificate_snapshots'] = array(
'description' => t('Stores snapshots of users certificate for a particular course.'),
'fields' => array(
'csid' => array(
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
'description' => 'Unique identifier for the per-user / per-course certificate snapshot.',
),
'uid' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => '{user}.uid of the u.',
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => '{node}.nid of the node.',
),
'date' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => NULL,
'description' => 'Date the certificate was generated.',
),
'snapshot' => array(
'description' => t('The generated content of the {certificate_snapshots}.'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array(
'csid',
),
);
return $schema;
}