INSERT t INTO elections (type, name, voting_start, voting_end, choices_nb, question) VALUES ("elections", "2011 Spring Election", "2011-05-29 00:00:00", "2011-06-12 23:59:59", "7", "Which candidates would you like to see Elected?");
set @el_id = @@IDENTITY;
INSERT INTO election_choices (election_id, choice) VALUES
(@el_id, 'Candidate 1'),
(@el_id, 'Candidate 2'),
(@el_id, 'Candidate 3'),
(@el_id, 'Candidate 4');
INSERT INTO election_voters (election_id, email_address) VALUES
(@el_id, 'voter1@example.org'),
(@el_id, 'voter2@example.org'),
(@el_id, 'voter3@example.com'),
(@el_id, 'voter4@example.net');
INSERT INTO election_tmp_tokens (election_id, election_voter_id, tmp_token)
SELECT @el_id, id, SUBSTRING(MD5(RAND()) FROM 1 FOR 24) AS tmp_token