/[drupal]/contributions/modules/votingapi/votingapi.schema
ViewVC logotype

Contents of /contributions/modules/votingapi/votingapi.schema

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Wed Aug 1 04:34:25 2007 UTC (2 years, 3 months ago) by eaton
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1, DRUPAL-6--2
Changes since 1.3: +2 -2 lines
Many, many bugs fixed. 2.0 API still in flux.
1 <?php
2 // $Id: votingapi.schema,v 1.3 2007/07/17 05:54:17 eaton Exp $
3
4 function votingapi_schema() {
5 $schema['votingapi_vote'] = array(
6 'fields' => array(
7 'vote_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
8 'content_type' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'node'),
9 'content_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
10 'value' => array('type' => 'float', 'not null' => TRUE, 'default' => 0),
11 'value_type' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'percent'),
12 'tag' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'vote'),
13 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
14 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
15 'vote_source' => array('type' => 'varchar', 'length' => 255),
16 ),
17 'primary key' => array('vote_id'),
18 'indexes' => array(
19 'content' => array('content_type', 'content_id'),
20 'content_uid' => array('content_type', 'content_id', 'uid'),
21 'content_source' => array('content_type', 'content_id', 'vote_source'),
22 ),
23 );
24 $schema['votingapi_cache'] = array(
25 'fields' => array(
26 'vote_cache_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
27 'content_type' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'node'),
28 'content_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
29 'value' => array('type' => 'float', 'not null' => TRUE, 'default' => 0),
30 'value_type' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'percent'),
31 'tag' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'vote'),
32 'function' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
33 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
34 ),
35 'primary key' => array('vote_cache_id'),
36 'indexes' => array(
37 'content' => array('content_type', 'content_id'),
38 'content_function' => array('content_type', 'content_id', 'function'),
39 ),
40 );
41 return $schema;
42 }

  ViewVC Help
Powered by ViewVC 1.1.2