shurly_service.install in ShURLy 6
File
shurly_service/shurly_service.install
View source
<?php
function shurly_service_schema() {
$schema['shurly_keys'] = array(
'description' => t('API keys for use with the Shurly module'),
'fields' => array(
'uid' => array(
'description' => t('User ID'),
'type' => 'int',
'not null' => TRUE,
),
'apikey' => array(
'description' => t('API key for user'),
'type' => 'varchar',
'length' => '35',
'not null' => TRUE,
),
),
'primary key' => array(
'apikey',
),
'indexes' => array(
'uid' => array(
'uid',
),
),
);
return $schema;
}
function shurly_service_install() {
drupal_install_schema('shurly_service');
}
function shurly_service_update_6100() {
$module = 'shurly_service';
$schema = drupal_get_schema_unprocessed($module);
_drupal_initialize_schema($module, $schema);
$ret = array();
db_create_table($ret, 'shurly_keys', $schema['shurly_keys']);
return $ret;
}
function shurly_service_uninstall() {
drupal_uninstall_schema('shurly_service');
}