progress.install in Progress 7
Same filename and directory in other branches
Installation file for the Progress module
File
progress.installView source
<?php
/**
* @file
*
* Installation file for the Progress module
*
*/
function progress_schema() {
$schema = array();
$schema['progress'] = array(
'description' => 'Progress',
'fields' => array(
'name' => array(
'description' => 'Name of progress',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'progress' => array(
'description' => 'Progress status',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
),
'message' => array(
'description' => 'Message for current progress',
'type' => 'text',
'not null' => TRUE,
),
'start_stamp' => array(
'description' => 'Start time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
),
'end_stamp' => array(
'description' => 'End time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
),
'current_stamp' => array(
'description' => 'Current time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'name',
),
);
return $schema;
}
/**
* Major version upgrade of Drupal
*/
function progress_update_7000() {
}
/**
* Change schema to SQL 99 compliance
*/
function progress_update_7101() {
if (db_field_exists('progress', 'start')) {
db_change_field('progress', 'start', 'start_stamp', array(
'description' => 'Start time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
));
}
if (db_field_exists('progress', 'end')) {
db_change_field('progress', 'end', 'end_stamp', array(
'description' => 'End time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
));
}
if (db_field_exists('progress', 'current')) {
db_change_field('progress', 'current', 'current_stamp', array(
'description' => 'Current time in unix timestamp',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
));
}
}
Functions
Name | Description |
---|---|
progress_schema | @file |
progress_update_7000 | Major version upgrade of Drupal |
progress_update_7101 | Change schema to SQL 99 compliance |