drupal/modules/poll/poll.schema

43 lines
1.6 KiB
Plaintext

<?php
// $Id$
function poll_schema() {
$schema['poll'] = array(
'fields' => array(
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'runtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'active' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
),
'primary key' => array('nid'),
);
$schema['poll_choices'] = array(
'fields' => array(
'chid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'chtext' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'chvotes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
),
'indexes' => array('nid' => array('nid')),
'primary key' => array('chid'),
);
$schema['poll_votes'] = array(
'fields' => array(
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => -1),
'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '')
),
'indexes' => array(
'hostname' => array('hostname'),
'nid' => array('nid'),
'uid' => array('uid')
),
);
return $schema;
}