You are here

function fancy_file_delete_update_7101 in Fancy File Delete 7

Ironically adding a DB table to handle unmanaged files.

File

./fancy_file_delete.install, line 80
Install File for Fancy File Delete.

Code

function fancy_file_delete_update_7101() {

  // If the unamanged tables doesnt exist.
  if (!db_table_exists('unmanaged_files')) {
    $schema['unmanaged_files'] = array(
      'description' => 'Ironically adding Unmanaged files to the DB so we can use this to delete the files.',
      'fields' => array(
        'unfid' => array(
          'description' => 'The primary identifier for the entity.',
          'type' => 'serial',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'path' => array(
          'description' => 'The path of the file.',
          'type' => 'text',
          'size' => 'big',
          'serialize' => TRUE,
          'object default' => array(),
        ),
      ),
      'primary key' => array(
        'unfid',
      ),
    );

    // Add the unmanaged table in.
    db_create_table('unmanaged_files', $schema['unmanaged_files']);
  }
}