Download & Extend

Field event_timezones.offset & event_timezones.offset_dst: no Schema type for mysql type time

Project:Event
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I always have these error message on my admin page:

* Field event_timezones.offset: no Schema type for mysql type time.
* Field event_timezones.offset_dst: no Schema type for mysql type time.
* Field storage_object.md5: no Schema type for mysql type binary.
* Field storage_object.whirlpool: no Schema type for mysql type binary.

Think these errors happened in different installations and worked on this problem a few months ago without result, so I wonder if removing and reinstalling helps...

(I searched this error message in Drupal and there was none; the issue que is to hughe for me to look through all issues if there is another that handles this without mentioning the error message)

Comments

#1

I also get the following messages on my Open Atrium:

* Field event_timezones.offset: no Schema type for mysql type time.
* Field event_timezones.offset_dst: no Schema type for mysql type time.

#2

I use a database prefix, so the error message contains the prefix as well, like "Field 'dbprefixname'event_timezones.offset ..." etc.

To be clear: I use module Schema that reports these database errors/inconsistencies that not necessarily immediately result in system halts or other severe errors. But any minor defect can support in the derailment of the whole system, like an airplane crash when mostly several minor errors & imperfect human response to them come together. Or clogging up the db error list resulting in ignoring the list and more important errors, what then result in a system failure.

http://drupal.org/project/schema

#3

I have the same two warning messages at the top of the admin page. I also noted that Schema reports event_timezones as an Extra table.

Tables in the database that are not present in the schema. This indicates previously installed modules that are disabled but not un-installed or modules that do not use the Schema API.

    * event_timezones

I accidentally deleted the table while cleaning up a bunch of unused cruft. I think the event module included the event table in the schema API but neglected to include the event_timezones table.


Edit: Additional information. The Schema Inspect shows that the event module defines the schema for the 'event' table, but the 'event_timezones' table is unknown. The following should be added to the event modules schema definition.
$schema['event_timezones'] = array(
  'description' => t('TODO: please describe this table!'),
  'fields' => array(
    'timezone' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
    'name' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'varchar',
      'length' => '255',
      'not null' => TRUE,
      'default' => '',
    ),
    'offset' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'time',
      'not null' => TRUE,
      'default' => '00:00:00',
    ),
    'offset_dst' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'time',
      'not null' => TRUE,
      'default' => '00:00:00',
    ),
    'dst_region' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
    'is_dst' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
  ),
  'primary key' => array('timezone'),
);

#4

Specifically, in what file or files do I need to enter the above code?

#5

#6

dude4linux's schema for event_timezones on postgresql produces the warning:

* Field event_timezones.offset: no Schema type for pgsql type interval.
* Field event_timezones.offset_dst: no Schema type for pgsql type interval.
* event_timezones.offset: no type for Schema type time:normal.
* Field event_timezones.offset: no Schema type for type time.
* event_timezones.offset_dst: no type for Schema type time:normal.
* Field event_timezones.offset_dst: no Schema type for type time.

and event_timezones shows up as a mismatch.

The problem is, of course, that there is no Schema API type for mysql time or pgsql interval. You're not going to totally eliminate Schema warnings until there is a Schema API type for this. The best I can come up so far at least eliminates the mismatch:

$schema['event_timezones'] = array(
  'description' => t('TODO: please describe this table!'),
  'fields' => array(
    'timezone' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
    'name' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'varchar',
      'length' => '255',
      'not null' => TRUE,
      'default' => '',
    ),
    'offset' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'varchar',
      'mysql_type' => 'time',
      'pgsql_type' => 'interval',
      'not null' => TRUE,
      'default' => '00:00:00',
    ),
    'offset_dst' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'varchar',
      'mysql_type' => 'time',
      'pgsql_type' => 'interval',
      'not null' => TRUE,
      'default' => '00:00:00',
    ),
    'dst_region' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
    'is_dst' => array(
      'description' => t('TODO: please describe this field!'),
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
  ),
  'primary key' => array('timezone'),
);

lvadillo, this goes in event.install, inside the event_schema function.

nobody click here