I'm building a module for Drupal 7, but having troubleI have troubles with my schema, and can't see what the issue isI don't understand why.
This is my schema.
ThenI get this is the error I'm getting.
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 'NULL DEFAULT NULL, `end_time` NULL DEFAULT NULL, `duration` INT unsigned NOT ' at line 5: CREATE TABLE {table_name} ( `id` INT unsigned NOT NULL auto_increment, `nid` INT unsigned NOT NULL, `oid` INT unsigned NOT NULL, `start_time` NULL DEFAULT NULL, `end_time` NULL DEFAULT NULL, `duration` INT unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `0` () ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8; Array ( ) in db_create_table() (line 2717 of /Applications/MAMP/htdocs/project/www/includes/database/database.inc). 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 'NULL DEFAULT NULL,
end_timeNULL DEFAULT NULL,durationINT unsigned NOT ' at line 5: CREATE TABLE {table_name} (idINT unsigned NOT NULL auto_increment,nidINT unsigned NOT NULL,oidINT unsigned NOT NULL,start_timeNULL DEFAULT NULL,end_timeNULL DEFAULT NULL,durationINT unsigned NOT NULL, PRIMARY KEY (id), UNIQUE KEY0() ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8; Array ( ) in db_create_table() (line 2717 of /Applications/MAMP/htdocs/project/www/includes/database/database.inc).
Been trying to work out what's wrong for a while now, any help will be appreciated!How can I fix this error?