Schema module warning
panels_node.did is part of the primary key but is not specified to be 'not null'.

Primary key cant be null and why it is not serial?

panels_node.install

  $schema['panels_node'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'css_id' => array(
        'type' => 'varchar',
        'length' => '255',
      ),
      'did' => array(
        'type' => 'int',
+        'not null' => TRUE,
      ),
    ),
    'primary key' => array('did'),
  );

Comments

andypost’s picture

Title: Schema fix » Schema fix - panels pages
Component: Code » Panel pages

It's not a duplicate just for pages

  • panels_page

    • column did:
      declared: array('type' => 'int', 'default' => )
      actual: array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11')
    • column did: key 'not null' not set, ignoring inspected default value
    • column title: key 'not null' not set, ignoring inspected default value
    • column access: key 'not null' not set, ignoring inspected default value
    • column path: key 'not null' not set, ignoring inspected default value
    • column css_id: key 'not null' not set, ignoring inspected default value
    • column css: key 'not null' not set, ignoring inspected default value
    • column arguments: key 'not null' not set, ignoring inspected default value
    • column displays: key 'not null' not set, ignoring inspected default value
    • column contexts: key 'not null' not set, ignoring inspected default value
    • column relationships: key 'not null' not set, ignoring inspected default value
    • column no_blocks: key 'not null' not set, ignoring inspected default value
    • column menu: key 'not null' not set, ignoring inspected default value
    • column menu_tab_weight: key 'not null' not set, ignoring inspected default value
    • column menu_title: key 'not null' not set, ignoring inspected default value
    • column menu_tab_default: key 'not null' not set, ignoring inspected default value
    • column menu_tab_default_parent_type: key 'not null' not set, ignoring inspected default value
    • column menu_parent_title: key 'not null' not set, ignoring inspected default value
    • column menu_parent_tab_weight: key 'not null' not set, ignoring inspected default value
merlinofchaos’s picture

If it can't be null why is it bad to specify it as NOT NULL? Is there something wrong with explicitness?

It's not serial because it refers to another table, it's just set up as the primary key because it's already guaranteed to be unique and that provides a nice easy index.

andypost’s picture

Just testing this module by Schema module which find some differences between DB structure and schema definitions

merlinofchaos’s picture

Status: Needs work » Closed (won't fix)

Panels 2 is no longer available and is unsupported. Marking all Panels 2 issues won't fix.