poll stuff
This commit is contained in:
parent
5d35d21100
commit
d8ef1417fb
2
boot.php
2
boot.php
@ -43,7 +43,7 @@ require_once('include/taxonomy.php');
|
|||||||
define ( 'RED_PLATFORM', 'Red Matrix' );
|
define ( 'RED_PLATFORM', 'Red Matrix' );
|
||||||
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
||||||
define ( 'ZOT_REVISION', 1 );
|
define ( 'ZOT_REVISION', 1 );
|
||||||
define ( 'DB_UPDATE_VERSION', 1061 );
|
define ( 'DB_UPDATE_VERSION', 1063 );
|
||||||
|
|
||||||
define ( 'EOL', '<br />' . "\r\n" );
|
define ( 'EOL', '<br />' . "\r\n" );
|
||||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||||
|
@ -666,6 +666,29 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
|||||||
KEY `resource_id` (`resource_id`)
|
KEY `resource_id` (`resource_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `poll` (
|
||||||
|
`poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`poll_channel` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`poll_desc` text NOT NULL,
|
||||||
|
`poll_flags` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`poll_votes` int(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`poll_id`),
|
||||||
|
KEY `poll_channel` (`poll_channel`),
|
||||||
|
KEY `poll_flags` (`poll_flags`),
|
||||||
|
KEY `poll_votes` (`poll_votes`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `poll_elm` (
|
||||||
|
`pelm_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`pelm_poll` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`pelm_desc` text NOT NULL,
|
||||||
|
`pelm_flags` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`pelm_result` float NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`pelm_id`),
|
||||||
|
KEY `pelm_poll` (`pelm_poll`),
|
||||||
|
KEY `pelm_result` (`pelm_result`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `profile` (
|
CREATE TABLE IF NOT EXISTS `profile` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_guid` char(64) NOT NULL DEFAULT '',
|
`profile_guid` char(64) NOT NULL DEFAULT '',
|
||||||
@ -886,7 +909,9 @@ CREATE TABLE IF NOT EXISTS `vote` (
|
|||||||
`vote_result` text NOT NULL,
|
`vote_result` text NOT NULL,
|
||||||
`vote_xchan` char(255) NOT NULL DEFAULT '',
|
`vote_xchan` char(255) NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (`vote_id`),
|
PRIMARY KEY (`vote_id`),
|
||||||
UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`)
|
UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`),
|
||||||
|
KEY `vote_poll` (`vote_poll`),
|
||||||
|
KEY `vote_element` (`vote_element`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `xchan` (
|
CREATE TABLE IF NOT EXISTS `xchan` (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define( 'UPDATE_VERSION' , 1061 );
|
define( 'UPDATE_VERSION' , 1063 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -706,3 +706,39 @@ function update_r1060() {
|
|||||||
return UPDATE_SUCCESS;
|
return UPDATE_SUCCESS;
|
||||||
return UPDATE_FAILED;
|
return UPDATE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_r1061() {
|
||||||
|
$r = q("ALTER TABLE `vote` ADD INDEX ( `vote_poll` ), ADD INDEX ( `vote_element` ) ");
|
||||||
|
|
||||||
|
if($r)
|
||||||
|
return UPDATE_SUCCESS;
|
||||||
|
return UPDATE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_r1062() {
|
||||||
|
$r1 = q("CREATE TABLE IF NOT EXISTS `poll` (
|
||||||
|
`poll_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||||
|
`poll_channel` INT UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`poll_desc` TEXT NOT NULL DEFAULT '',
|
||||||
|
`poll_flags` INT NOT NULL DEFAULT '0',
|
||||||
|
`poll_votes` INT NOT NULL DEFAULT '0',
|
||||||
|
KEY `poll_channel` (`poll_channel`),
|
||||||
|
KEY `poll_flags` (`poll_flags`),
|
||||||
|
KEY `poll_votes` (`poll_votes`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
|
||||||
|
|
||||||
|
$r2 = q("CREATE TABLE IF NOT EXISTS `poll_elm` (
|
||||||
|
`pelm_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||||
|
`pelm_poll` INT UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`pelm_desc` TEXT NOT NULL DEFAULT '',
|
||||||
|
`pelm_flags` INT NOT NULL DEFAULT '0',
|
||||||
|
`pelm_result` FLOAT NOT NULL DEFAULT '0',
|
||||||
|
KEY `pelm_poll` (`pelm_poll`),
|
||||||
|
KEY `pelm_result` (`pelm_result`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
|
||||||
|
|
||||||
|
if($r1 && $r2)
|
||||||
|
return UPDATE_SUCCESS;
|
||||||
|
return UPDATE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-08-20.411
|
2013-08-21.412
|
||||||
|
Reference in New Issue
Block a user