Referendum is an issue voting system.
Essentially Referendum is a simple CRUD application, users insert votes, issues and ballots, and then read them out in tables.
-- Database: `referendum`
--
-- --------------------------------------------------------
--
-- Table structure for table `ballots`
--
CREATE TABLE `ballots` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`description` text collate utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`updated` timestamp NOT NULL default CURRENT_TIMESTAMP,
`password` varchar(32) collate utf8_unicode_ci NOT NULL default '',
`css` text collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `created` (`created`,`updated`),
FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
-- --------------------------------------------------------
--
-- Table structure for table `issues`
--
CREATE TABLE `issues` (
`id` int(11) NOT NULL auto_increment,
`ballot_id` int(11) NOT NULL default '0',
`title` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`description` text collate utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`name` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`ip` int(4) NOT NULL default '0',
`link` text collate utf8_unicode_ci NOT NULL,
`approved` tinyint(1) NOT NULL default '0',
`homepage` text collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `ballot_id` (`ballot_id`),
KEY `approved` (`approved`),
FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- Table structure for table `votes`
--
CREATE TABLE `votes` (
`id` int(11) NOT NULL auto_increment,
`issue_id` int(11) NOT NULL default '0',
`ip` int(4) NOT NULL default '0',
`vote` tinyint(1) NOT NULL default '0',
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ballot_id` (`issue_id`,`ip`,`vote`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=70 ;
Documentation
Referendum