Dabei sollen alle Mitglieder die Change haben, ihre Admins/Mods zu wählen
Meine SQL-Schema-Idee wäre die folgende:
- Code: Alles auswählen
- CREATE TABLE IF NOT EXISTS `comm_elections` (
`id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`role_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`comment` text COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(2) unsigned NOT NULL DEFAULT '0',
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `comm_election_nominees` (
`id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`election_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`user_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`comment` text COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '-1=declined; 1=accepted',
`votes` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'sum of votes - redundant',
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `comm_election_votes` (
`id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`election_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`election_nominee_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`user_id` char(36) COLLATE utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
und in den configs einstellbar:
- votes_per_user (defaults to 1)
- allow_vote_oneself (true/false)
- requirements (z.b. register_date > ... oder user_points > ...)
- min_turnout (minimale wahlbeteiligung für gültige wahl)
- min_nominees (wie viele müssen mindestens zur wahl stehen = vorher nominiert werden)
- amount_winners (wie viele wahlsieger gibt es - standard: 1)
- ...
habt ihr noch irgendwelche anregungen oder dinge, die bisher nicht bedacht worden sind?

