Hi,

if you check you database via path admin/build/schema/compare, you get the following warning:

"profile_privacy_fields.fid is part of the primary key but is not specified to be 'not null'."
(see attached screenshot as well)

As you can see, attribute 'not null' => TRUE is missing for fid in schema definition:

<?php 

function profile_privacy_schema() {
  $schema['profile_privacy_fields'] = array(
    'fields' => array(
      'fid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'default' => 0
      ),
      'privacy' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0
      )
    ),
    'primary key' => array('fid')
  );
?>

Comments

not_Dries_Buytaert’s picture

Same here (running: schema-6.x-1.7: http://drupal.org/project/schema). The code quoted in the startpost is from the file 'profile_privacy.install'.

cor3huis’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new349 bytes

Added

cpliakas’s picture

Status: Patch (to be ported) » Needs work

Great work discovering this. Marking as "needs work" because a change like this requires an update hook in order to modify the schema. Also, the profile_privacy_values table could use a NOT NULL declaration as well.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new1.75 KB

Looks like the patch posted in #2 is already in the 6.x-1.x branch. The attached patch was committed to the downstream project at #1268256: Schema definition inconsistency.

cpliakas’s picture

Version: 6.x-1.2 » 6.x-2.x-dev
Status: Needs review » Fixed

Moving to 6.x-2.x branch. Committed at 44e798c.

Status: Fixed » Closed (fixed)

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