You are here

function table_trash_update_7001 in Table Trash 7

Create the table_trash table.

File

./table_trash.install, line 109
Install and uninstall functions for the table_trash module.

Code

function table_trash_update_7001() {
  $schema['table_trash'] = array(
    'description' => 'Stores table trash configuration.',
    'export' => array(
      'key' => 'machine_name',
      'key name' => 'Machine Name',
      'identifier' => 'table_trash_decoration',
      'primary key' => 'machine_name',
      'default hook' => 'default_table_trash_decoration',
      'can disable' => FALSE,
      'admin_title' => 'name',
      'admin_description' => 'description',
      'api' => array(
        'owner' => 'table_trash',
        'api' => 'default_table_trash_decorations',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'did' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The decoration ID of the field, defined by the database.',
        'no export' => TRUE,
      ),
      'machine_name' => array(
        'description' => 'Exportable object machine name.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 64,
        'default' => '',
        'not null' => TRUE,
        'description' => 'The unique name of the decoration. This is the primary field decorations are loaded from, and is used so that decorations may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
      ),
      'description' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => 'A description of the decoration for the admin interface.',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The weight of this decoration in listings and the user interface.',
      ),
      'data' => array(
        'description' => 'Serialized data of exportable object.',
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
        'object default' => array(),
      ),
    ),
    'primary key' => array(
      'did',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );
  db_create_table('table_trash', $schema['table_trash']);
}