/[drupal]/contributions/modules/workflow_named_transitions/workflow_named_transitions.install
ViewVC logotype

Contents of /contributions/modules/workflow_named_transitions/workflow_named_transitions.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Tue Apr 14 13:29:37 2009 UTC (7 months, 1 week ago) by deekayen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -3 lines
File MIME type: text/x-php
#431482 Port to D6 request by ntt
I've been using it in production for a couple weeks and this commit is now compliant with coder tough love tests.
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Manage the workflow_named_transitions table and the module weight.
7 */
8
9 /**
10 * Implementation of hook_schema().
11 */
12 function workflow_named_transitions_schema() {
13 $schema['workflow_named_transitions'] = array(
14 'fields' => array(
15 'tid' => array(
16 'type' => 'int',
17 'unsigned' => TRUE,
18 'not null' => TRUE,
19 'disp-width' => '10'
20 ),
21 'label' => array(
22 'type' => 'varchar',
23 'length' => '255',
24 'not null' => TRUE
25 )
26 ),
27 'primary key' => array('tid')
28 );
29 return $schema;
30 }
31
32 /**
33 * Implementation of hook_install().
34 *
35 * Add the workflow_named_transitions table for storing labels for each
36 * workflow transition ID (tid) and set the weight to be one more than
37 * the workflow module to make sure this module's form alter hook executes
38 * after the one in the workflow module.
39 */
40 function workflow_named_transitions_install() {
41 drupal_install_schema('workflow_named_transitions');
42 $workflow_weight = db_result(db_query_range("SELECT weight FROM {system} WHERE name = 'workflow'", 0, 1));
43 db_query("UPDATE {system} SET weight = %d + 1 WHERE name = 'workflow_named_transitions'", $workflow_weight);
44 }
45
46 /**
47 * Implementation of hook_uninstall().
48 *
49 * Drop the workflow_named_transitions table.
50 */
51 function workflow_named_transitions_uninstall() {
52 drupal_uninstall_schema('workflow_named_transitions');
53 }

  ViewVC Help
Powered by ViewVC 1.1.2