You are here

function socialmedia_schema in Social media 7

Implements hook_schema().

File

./socialmedia.install, line 30
Install, update and uninstall functions for the widgets module.

Code

function socialmedia_schema() {
  $schema = array();
  $schema['socialmedia_profile'] = array(
    'description' => 'Stores social media profile data',
    'fields' => array(
      'smid' => array(
        'description' => 'Primary id',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'platform' => array(
        'description' => 'machine name identifier of the platform of the profile',
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'User id the profile belongs to. Site profiles have a uid of 0',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'Profile data',
        'type' => 'text',
        //'serialize' => TRUE, // TODO set field to serialize
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'smid',
    ),
    'indexes' => array(
      'platform' => array(
        'platform',
        'uid',
      ),
    ),
  );
  return $schema;
}