Hello,

I installed this module, and noticed that it creates and 'Extra' table in my database (fsrange_facets) according to the Schema module.

I don't have a good sense for how the Schema module flags this table as being 'Extra', but did want to ask whether or not this table is truly being used in this module or whether it's a leftover from an old version of the module.

Cheers,
Bryce

Comments

brycesenz’s picture

Assigned: Unassigned » brycesenz
Status: Active » Needs review

Ok, I finally got around to really investigating this myself, and here's what's up: the current fsrange.install file doesn't use schema to install the database tables. I believe that using schema is strongly preferred nowadays, so I'm presenting an alternative .install file:

// $Id$

/**
 * @file install (and uninstall) settings for fsrange module
 */
 
/**
 * Implementation of hook_schema().
 */
function fsrange_schema() {
  $schema['fsrange_facets'] = array(
    'fields' => array(
      'rfid' => array(
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'field_name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => ''
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => ''
      ),
      'description' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => ''
      ),
      'options' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array('rfid'),
  );
  
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function fsrange_install() {
  // Create tables.
  drupal_install_schema('fsrange');
}

/**
 * Implementation of hook_uninstall().
 */
function fsrange_uninstall() {
  // Remove tables.
  drupal_uninstall_schema('fsrange');
  drupal_set_message('All FS Range settings have been cleared.');

I've tried installing/using/uninstalling this module on my machine, and everything works great (and now plays nicely with schema). I'd love to see this work its way into a future commit, but for now anyone who wants to use this fix will just have to replace their .install file with the code above.