This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.php
71 lines (63 loc) · 3.35 KB
/
tables.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Copyright Zikula Foundation 2009 - Zikula Application Framework
*
* This work is contributed to the Zikula Foundation under one or more
* Contributor Agreements and licensed to You under the following license:
*
* @license GNU/LGPLv3 (or at your option, any later version).
* @package Zikula
*
* Please see the NOTICE file distributed with this source code for further
* information regarding copyright and licensing.
*/
/**
* Populate tables array
*
* @return array tables array
*/
function Polls_tables()
{
$table = array();
// voting check table
$table['poll_check'] = DBUtil::getLimitedTablename('poll_check');
$table['poll_check_column'] = array('ip' => 'pn_ip',
'time' => 'pn_time');
$table['poll_check_column_def'] = array('ip' => "C(20) NOTNULL DEFAULT ''",
'time' => "C(14) NOTNULL DEFAULT ''");
$table['poll_check_column_idx'] = array('ip' => 'ip');
// option data table
$table['poll_data'] = DBUtil::getLimitedTablename('poll_data');
$table['poll_data_column'] = array('pollid' => 'pn_pollid',
'optiontext' => 'pn_optiontext',
'optioncount' => 'pn_optioncount',
'voteid' => 'pn_voteid');
$table['poll_data_column_def'] = array('pollid' => "I NOTNULL DEFAULT '0'",
'optiontext' => "C(255) NOTNULL DEFAULT ''",
'optioncount' => "I NOTNULL DEFAULT '0'",
'voteid' => "I NOTNULL DEFAULT '0'");
$table['poll_data_column_idx'] = array('pollid' => 'pollid');
// desc table
$table['poll_desc'] = DBUtil::getLimitedTablename('poll_desc');
$table['poll_desc_column'] = array('pollid' => 'pn_pollid',
'title' => 'pn_title',
'urltitle' => 'pn_urltitle',
'timestamp' => 'pn_timestamp',
'voters' => 'pn_voters',
'language' => 'pn_language');
$table['poll_desc_column_def'] = array('pollid' => 'I NOTNULL AUTOINCREMENT PRIMARY',
'title' => "C(255) NOTNULL DEFAULT ''",
'urltitle' => "X NOTNULL DEFAULT ''",
'timestamp' => "I NOTNULL DEFAULT '0'",
'voters' => "I4 NOTNULL DEFAULT '0'",
'language' => "C(30) NOTNULL DEFAULT ''");
// Enable categorization services
$table['poll_desc_db_extra_enable_categorization'] = ModUtil::getVar('Polls', 'enablecategorization');
$table['poll_desc_primary_key_column'] = 'pollid';
// add standard data fields
ObjectUtil::addStandardFieldsToTableDefinition ($table['poll_desc_column'], 'pn_');
ObjectUtil::addStandardFieldsToTableDataDefinition($table['poll_desc_column_def']);
// old tables for upgrade/renaming purposes
$table['pollcomments'] = DBUtil::getLimitedTablename('pollcomments');
return $table;
}