12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * @file
- * Workflow access installation.
- */
- /**
- * Implements hook_schema().
- */
- function workflow_access_schema() {
- $schema['workflow_access'] = array(
- 'description' => 'Workflow access tables',
- 'fields' => array(
- 'sid' => array(
- 'type' => 'int',
- 'description' => 'The Workflow state ID.',
- 'not null' => TRUE,
- ),
- 'rid' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- 'grant_view' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'size' => 'tiny',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'grant_update' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'size' => 'tiny',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'grant_delete' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'size' => 'tiny',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('sid', 'rid'),
- 'indexes' => array(
- 'rid' => array('rid'),
- ),
- );
- return $schema;
- }
- /**
- * Force rebuild of node access.
- */
- function workflow_access_disable() {
- node_access_needs_rebuild(TRUE);
- }
- /**
- * Correct field type of field 'sid' in workflow_access table.
- */
- function workflow_access_update_7001() {
- db_drop_primary_key('workflow_access');
- db_add_primary_key('workflow_access', array('sid', 'rid'));
- db_drop_index('workflow_access', 'sid');
- db_drop_index('workflow_access', 'rid');
- db_change_field('workflow_access', 'sid', 'sid', array(
- 'type' => 'int',
- 'not null' => TRUE,
- ));
- db_drop_primary_key('workflow_access');
- db_add_primary_key('workflow_access', array('sid', 'rid'));
- db_add_index('workflow_access', 'rid', array('rid'));
- }
- /**
- * Force rebuild of node access.
- */
- function workflow_access_update_7002() {
- node_access_needs_rebuild(TRUE);
- }
|