Skip to content

Instantly share code, notes, and snippets.

@xtfer
Created April 22, 2013 03:52
Show Gist options
  • Save xtfer/5432342 to your computer and use it in GitHub Desktop.
Save xtfer/5432342 to your computer and use it in GitHub Desktop.
Fix for PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.type' in 'field list': SELECT base.fid AS fid, base.uid
$spec = array(
'description' => 'The type of this file.',
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
// If the FILE_TYPE_NONE constant ever changes, then change the value here
// too, and add an update function to deal with existing records. The
// constant isn't used here, because there may be cases where this function
// runs without the module file loaded.
'default' => 'undefined',
);
$indexes_new = array('indexes' => array('file_type' => array('type')));
db_add_field('file_managed', 'type', $spec, $indexes_new);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment