When installing, support_nag gave me an error message because "text" columns (used for the message field) cannot have default values:
http://dev.mysql.com/doc/refman/5.0/en/blob.html

I took the install schema and wrote it into sql and manually created the table, removing the "default" statement for the message field.

create table support_nags (
    nagid serial not null,
    action int unsigned  not null  default  '0',
    clients varchar (255) not null default '',        
    states  varchar (255) not null default '',
    priorities varchar (255) not null default '',
    assigned  varchar (255) not null default '',
    mailto  varchar (255) not null  default '',
    subject  varchar (128) not null default '',
    message  text not null,
    frequency  int unsigned not null  default '0',
    last int unsigned not null default  '0',
    count int unsigned not null default  '0',
    primary key  (nagid),
  );

I also had a problem with the nagid field. I could not create the table with "unsigned" included in the create statement. I don't know why. I removed "unsigned" and the table was created. I know that "SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE."
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

I hope you find any of this helpful. If I have missed something (which is perfectly possible..heck, it's likely!), I'd be happy to learn.

mrweaver

Comments

rsevero’s picture

Project: Support Ticketing System » Support Nag
Version: 6.x-1.3 » 6.x-1.x-dev

Moving to the "Support Nag" project.

hkovacs’s picture

Title: database errors » message 'default' causes create table error
Version: 6.x-1.x-dev » 7.x-1.x-dev

I changed the title to be more user friendly. I changed the version to 7 since 6 is going EOL and I have this problem on 7.

The error occurs when enabling the module:
WD php: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'message' can't have a default value: [error]
CREATE TABLE {support_nags}.......

A nice explanation about this being a mysql failure can be found here http://stackoverflow.com/questions/3466872/why-cant-a-text-column-have-a...

In support_nag.install, I commented line 75 message 'default'.

Enable module is now successful.

I can roll a patch over the weekend. Right now I just wanted to get this installed.

HTH

hkovacs’s picture

Here's the patch. HTH

  • Jeremy committed fadfce9 on 7.x-1.x authored by hkovacs
    Issue #964912 by hkovacs, Jeremy: message 'default' causes create table...
jeremy’s picture

Status: Active » Fixed

Thanks! Rather than comment it out I deleted it. Applied:
http://cgit.drupalcode.org/support_nag/commit/?id=fadfce9

hkovacs’s picture

Assigned: Unassigned » hkovacs

Yeah, I don't like to step on the maintainers toes, so I just commented it out. Deletion is much better.

Thanks for committing it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.