Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (85 sloc) 2.34 KB
<?php
// $Id$
/**
* Implementation of hook_schema().
*/
function bitly_schema() {
$schema['bitly_auth'] = array(
'description' => t('Stores bit.ly authentication tokens for each user.'),
'fields' => array(
'uid' => array(
'description' => t('User ID.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE),
'login' => array(
'description' => t("The user's bit.ly login."),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => ''),
'token' => array(
'description' => t("The user's bit.ly token."),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => ''),
'apikey' => array(
'description' => t("The user's bit.ly api key."),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => ''),
),
'primary key' => array('uid'),
);
$schema['bitly_hash'] = array(
'description' => t('Storage for bitly'),
'fields' => array(
'hid' => array(
'description' => t('The primary identifier for a hash.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE),
'uid' => array(
'description' => t('ID of user who created this hash.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'hash' => array(
'description' => t('Hash provided by bit.ly.'),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => ''),
'url' => array(
'description' => t('The full url of the link before hashing.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
),
'unique keys' => array(
'hash' => array('hash'),
),
'primary key' => array('hid'),
);
return $schema;
}
/**
* Implementation of hook_schema().
*/
function bitly_install() {
drupal_install_schema('bitly');
}
/**
* Implementation of hook_schema().
*/
function bitly_uninstall() {
drupal_uninstall_schema('bitly');
/* variable_del('bitly_login');
variable_del('bitly_key');
variable_del('bitly_client_id');
variable_del('bitly_client_secret');*/ // commented out to save headaches during development.
}
Jump to Line
Something went wrong with that request. Please try again.