In a module I'm building for Drupal 7 I'm trying to create a DB schema for the installing and uninstalling process. When enabling the module (and thus installing it) I get an error and my table is not created.
Can anybody see where it's going wrong?
<?php
/**
* Implementation of hook_schema().
*/
function wind_and_waves_schema() {
$schema['wind_and_waves'] = array(
'description' => 'Caches wind and waves data',
'fields' => array(
'id' => array(
'description' => 'The unique identifier for this item.',
'type' => 'serial',
'disp-width' => '11',
'unsigned' => TRUE,
),
'creation' => array(
'description' => 'Moment the data has been loaded',
'mysql_type' => 'datetime',
'disp-width' => '11',
),
'load_time' => array(
'description' => 'Moment the wind data has been loaded by rijkswaterstaat',
'mysql_type' => 'datetime',
'disp-width' => '11',
),
'hoek_wind_snelheid' => array(
'description' => 'Windsnelheid op hoek',
'type' => 'varchar',
'disp-width' => '11',
),
'hoek_wind_stoot' => array(
'description' => 'Windstoot op hoek',
'type' => 'varchar',
'disp-width' => '11',
),
'hoek_wind_richting' => array(
'description' => 'Windrichting op hoek',
'type' => 'varchar',
'disp-width' => '11',
),
'hoek_golf_hoogte' => array(
'description' => 'golfhoogte op hoek',
'type' => 'varchar',
'disp-width' => '11',
),
'ijmuiden_wind_snelheid' => array(
'description' => 'Windsnelheid op ijmuiden',
'type' => 'varchar',
'disp-width' => '11',
),
'ijmuiden_wind_stoot' => array(
'description' => 'Windstoot op ijmuiden',
'type' => 'varchar',
'disp-width' => '11',
),
'ijmuiden_wind_richting' => array(
'description' => 'Windrichting op ijmuiden',
'type' => 'varchar',
'disp-width' => '11',
),
'ijmuiden_golf_hoogte' => array(
'description' => 'golfhoogte op ijmuiden',
'type' => 'varchar',
'disp-width' => '11',
),
'golf_periode' => array(
'description' => 'golfperiode',
'type' => 'varchar',
'disp-width' => '11',
),
'watertemp' => array(
'description' => 'watertemperatuur',
'type' => 'varchar',
'disp-width' => '11',
),
'luchttemp' => array(
'description' => 'luchttemperatuur',
'type' => 'varchar',
'disp-width' => '11',
),
),
'primary key' => array('id'),
);
return $schema;
}
?>
The error I get:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL COMMENT 'Windsnelheid op hoek',
hoek_wind_stootVARCHAR DEFAULT ' at line 4: CREATE TABLE {wind_and_waves} (idINT unsigned auto_increment DEFAULT NULL COMMENT 'The unique identifier for this item.',creationDATETIME DEFAULT NULL COMMENT 'Moment the data has been loaded',hoek_wind_snelheidVARCHAR DEFAULT NULL COMMENT 'Windsnelheid op hoek',hoek_wind_stootVARCHAR DEFAULT NULL COMMENT 'Windstoot op hoek',hoek_wind_richtingVARCHAR DEFAULT NULL COMMENT 'Windrichting op hoek',hoek_golf_hoogteVARCHAR DEFAULT NULL COMMENT 'golfhoogte op hoek',ijmuiden_wind_snelheidVARCHAR DEFAULT NULL COMMENT 'Windsnelheid op ijmuiden',ijmuiden_wind_stootVARCHAR DEFAULT NULL COMMENT 'Windstoot op ijmuiden',ijmuiden_wind_richtingVARCHAR DEFAULT NULL COMMENT 'Windrichting op ijmuiden',ijmuiden_golf_hoogteVARCHAR DEFAULT NULL COMMENT 'golfhoogte op ijmuiden',golf_periodeVARCHAR DEFAULT NULL COMMENT 'golfperiode',watertempVARCHAR DEFAULT NULL COMMENT 'watertemperatuur',luchttempVARCHAR DEFAULT NULL COMMENT 'luchttemperatuur', PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Caches wind and waves data'; Array ( ) in db_create_table() (line 2657 of /home/sitede01/domains/sitedezign.net/public_html/includes/database/database.inc).