<?php

/**
 * Implementation of hook_schema().
 */
function pp_kw2011_portal_schema() {
$schema['pp_kw2011_portal'] = array(
  'description' => t('Stores the lastest area feeds'),
  'fields' => array(
    'id' => array(
      'description' => t('Unique identifier for each {pp_kw2011_portal} area feed.'),
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
    'type' => array(
      'description' => t('Type of the {pp_kw2011_portal} area feed.'),
      'type' => 'varchar',
      'length' => '10',
      'not null' => TRUE,
    ),
    'area' => array(
      'description' => t('Area of the {pp_kw2011_portal} area feed.'),
      'type' => 'varchar',
      'length' => '3',
      'not null' => TRUE,
    ),
    'title' => array(
      'description' => t('Title of the {pp_kw2011_portal} area feed.'),
      'type' => 'text',
      'not null' => TRUE,
    ),
    'link' => array(
      'description' => t('Link of the {pp_kw2011_portal} area feed.'),
      'type' => 'varchar',
      'length' => '255',
      'not null' => TRUE,
    ),
    'date' => array(
      'description' => t('Date of the {pp_kw2011_portal} area feed.'),
      'type' => 'datetime',
      'not null' => TRUE,
    ),
  ),
  'primary key' => array('id'),
  'unique keys' => array(
    'link' => array('link')
  ),
  'indexes' => array(
    'date' => array('date'),
  ),
);

  return $schema;
}

/**
 * Implementation of hook_install().
 */
function pp_kw2011_portal_install() {
  // Create tables.
  drupal_install_schema('pp_kw2011_portal');
}

/**
 * Implementation of hook_uninstall().
 */
function pp_kw2011_portal_uninstall() {
  // Remove tables.
  drupal_uninstall_schema('pp_kw2011_portal');
}
