function rules_update_7205

Add the rules_dependencies table and the rules_config.dirty column.

File

./rules.install, line 401

Code

function rules_update_7205() {
    if (!db_table_exists('rules_dependencies')) {
        $schema['rules_dependencies'] = array(
            'fields' => array(
                'id' => array(
                    'type' => 'int',
                    'unsigned' => TRUE,
                    'not null' => TRUE,
                    'description' => 'The primary identifier of the configuration.',
                ),
                'module' => array(
                    'type' => 'varchar',
                    'length' => '255',
                    'not null' => TRUE,
                    'description' => 'The name of the module that is required for the configuration.',
                ),
            ),
            'primary key' => array(
                'id',
                'module',
            ),
            'indexes' => array(
                'module' => array(
                    'module',
                ),
            ),
            'foreign keys' => array(
                'table' => 'rules_config',
                'columns' => array(
                    'id' => 'id',
                ),
            ),
        );
        db_create_table('rules_dependencies', $schema['rules_dependencies']);
    }
    if (!db_field_exists('rules_config', 'dirty')) {
        db_add_field('rules_config', 'dirty', array(
            'type' => 'int',
            'not null' => TRUE,
            'default' => 0,
            'size' => 'tiny',
        ));
    }
}