You are here

function uptolike_schema in Uptolike share buttons 7

Implements hook_schema().

File

./uptolike.install, line 11
Install and uninstall functions for Uptolike module.

Code

function uptolike_schema() {
  $schema['uptolike_preset'] = array(
    'description' => 'Table storing Uptolike presets definitions.',
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'pid',
      // Exports will be defined as $uptolike.
      'identifier' => 'uptolike',
      // Function hook name.
      'default hook' => 'default_uptolike_preset',
      'api' => array(
        'owner' => 'uptolike',
        // Base name for api include files.
        'api' => 'default_uptolike_presets',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for presets. Used to identify them programmatically.',
      ),
      'pid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        // Do not export database-only keys.
        'no export' => TRUE,
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'A human readable name of a preset.',
      ),
      'code' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Uptolike exportable configuration code.',
      ),
      'json' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Uptolike exportable configuration json.',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}