diff --git a/rules.install b/rules.install index 1a81d2f..2923275 100644 --- a/rules.install +++ b/rules.install @@ -87,13 +87,6 @@ function rules_schema() { 'length' => 255, 'not null' => FALSE, ), - 'owner' => array( - 'description' => 'The name of the module via which the rule has been configured.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => 'rules', - ), 'access_exposed' => array( 'type' => 'int', 'not null' => TRUE, @@ -117,6 +110,21 @@ function rules_schema() { 'plugin' => array('plugin'), ), ); + + // When upgrading to > 2.3 version field Owner won't be available until the + // rules_update_7211 has run and created the field. + // @see https://www.drupal.org/node/2094879 + $list = system_list('module_enabled'); + if (isset($list['rules']) && $list['rules']->schema_version >= 7211) { + $schema['rules_config']['owner'] = array( + 'description' => 'The name of the module via which the rule has been configured.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => 'rules', + ); + } + $schema['rules_trigger'] = array( 'fields' => array( 'id' => array(