function votingapi_update_4 in Voting API 6.2
Same name and namespace in other branches
- 5 votingapi.install \votingapi_update_4()
- 6 votingapi.install \votingapi_update_4()
Initial work to roll Voting Actions functionality into Voting API.
File
- ./
votingapi.install, line 104 - Installation file for VotingAPI module.
Code
function votingapi_update_4() {
$ret = array();
$name = 'votingapi_action_set';
$table_action_step = array(
'fields' => array(
'vasid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'parent' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'required' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'mask' => array(
'type' => 'varchar',
'default' => 'AND',
),
'content_type' => array(
'type' => 'varchar',
'length' => 20,
'default' => NULL,
),
'name' => array(
'type' => 'varchar',
'length' => 128,
'default' => NULL,
),
'enabled' => array(
'type' => 'int',
'default' => 1,
),
'source' => array(
'type' => 'varchar',
'length' => 65,
'default' => NULL,
),
'weight' => array(
'type' => 'int',
'length' => 10,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'vasid',
),
);
db_create_table($ret, $name, $table_action_set);
$name = 'votingapi_action_condition';
$table_action_condition = array(
'fields' => array(
'vacid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'vasid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'weight' => array(
'type' => 'int',
'length' => 10,
'not null' => TRUE,
'default' => 0,
),
'value' => array(
'type' => 'varchar',
'length' => 255,
),
'handler' => array(
'type' => 'varchar',
'length' => 255,
),
),
'primary key' => array(
'vacid',
),
);
db_create_table($ret, $name, $table_action_condition);
$name = 'votingapi_action';
$table_votingapi_action = array(
'fields' => array(
'vasid' => array(
'type' => 'int',
'length' => 10,
'unsigned' => TRUE,
'not null' => TRUE,
),
'aid' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 0,
),
),
);
db_create_table($ret, $name, $table_votingapi_action);
return $ret;
}