In the course of doing something similar to this module, amongst a number of things I found a pretty nasty bug in the install file. It's due to the use of 'tinyint' for the 'id'. This is just simply too small for a primary key. If you have more than 127 records, you may encounter problems using the table and over 255, a PDO Exception for sure since it can only hold 1 bit (255 is the largest number that can fit!)

Do it like this

<?php
function admin_notes_schema() {
  $schema['admin_notes'] = array(
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier for an admin note.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
//...
    ),
  );
}
?>

Comments

blasthaus’s picture

Issue summary: View changes
HansKuiters’s picture

I agree with 'tinyint' being too small for a primary key. Came across this bug today. Changed it to int(4) in db.

blasthaus’s picture

I ended up pretty much rewriting this module. If there is any interest from anyone, I can post it as a sandbox somewhere. It's working great. LMK

HansKuiters’s picture

For now it works fine, but I'm interested in your work.

HansKuiters’s picture

Status: Active » Reviewed & tested by the community
HansKuiters’s picture

Status: Reviewed & tested by the community » Active

Sorry, wrong issue.