You are here

function socialfeed_schema in Social Feed 6

Implements hook_schema().

File

./socialfeed.install, line 48
Install, update and uninstall functions for the XXX module.

Code

function socialfeed_schema() {
  $schema['socialfeed_post'] = array(
    'description' => 'Stores all data for the feed.',
    'fields' => array(
      'post_id' => array(
        'description' => 'Auto incremented ID.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => 'This is the id for the post.',
        'type' => 'varchar',
        'length' => '600',
        'not null' => TRUE,
      ),
      'time' => array(
        'description' => 'Created date for the post.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'message' => array(
        'description' => 'Message posted.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'fbtype' => array(
        'description' => 'This field will dictate the layout for Facebook posts.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'picture' => array(
        'description' => 'Image included in the post.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'link' => array(
        'description' => 'Url of the post.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'Name of the author.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => 'An additional message field.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'venue' => array(
        'description' => 'Name of the Foursquare venue',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
        'default' => '',
      ),
      'city' => array(
        'description' => 'City where the post was made.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
        'default' => '',
      ),
      'state' => array(
        'description' => 'State where the post was made.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'Title of the post.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
        'default' => '',
      ),
      'post_type' => array(
        'description' => 'Tells if this post is from Facebook, Twitter, Youtube, or Foursquare',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
        'default' => '',
      ),
      'shout' => array(
        'description' => 'Shout posted. This is for Foursquare.',
        'type' => 'varchar',
        'length' => '200',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'post_id',
    ),
    'indexes' => array(
      'timekey' => array(
        'time',
      ),
    ),
  );
  return $schema;
}