38458-vm/db/migrations/004_election_history_data.sql
2026-02-15 19:49:48 +00:00

23 lines
1.6 KiB
SQL

-- Past Elections for History
INSERT INTO elections (id, title, description, status, start_date_and_time, end_date_and_time, created_by) VALUES
('hist-uuid-1', 'School Year 2027-2028 Election', 'Previous year elections.', 'Finished', '2027-02-10 08:00:00', '2027-02-11 17:00:00', 'admin-uuid-1'),
('hist-uuid-2', 'School Year 2026-2027 Election', 'Elections from 2 years ago.', 'Finished', '2026-02-10 08:00:00', '2026-02-11 17:00:00', 'admin-uuid-1'),
('hist-uuid-3', 'School Year 2022-2023 Election', 'Older elections.', 'Finished', '2022-09-01 08:00:00', '2022-09-02 17:00:00', 'admin-uuid-1'),
('hist-uuid-4', 'School Year 2020-2021 Election', 'Archived elections.', 'Finished', '2020-09-01 08:00:00', '2020-09-02 17:00:00', 'admin-uuid-1');
-- Positions for 2027-2028
INSERT INTO positions (id, election_id, name, max_votes, sort_order) VALUES
('pos-hist-1', 'hist-uuid-1', 'President', 1, 1),
('pos-hist-2', 'hist-uuid-1', 'Vice President', 1, 2);
-- Candidates for 2027-2028
INSERT INTO candidates (id, election_id, position_id, user_id, party_name, approved) VALUES
('cand-hist-1', 'hist-uuid-1', 'pos-hist-1', 'voter-1', 'Unity Party', 1),
('cand-hist-2', 'hist-uuid-1', 'pos-hist-1', 'voter-2', 'Progress Party', 1);
-- Votes for 2027-2028
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at) VALUES
(REPLACE(UUID(), '-', ''), 'hist-uuid-1', 'pos-hist-1', 'cand-hist-1', 'voter-1', '2027-02-10 09:00:00'),
(REPLACE(UUID(), '-', ''), 'hist-uuid-1', 'pos-hist-1', 'cand-hist-1', 'voter-2', '2027-02-10 10:00:00'),
(REPLACE(UUID(), '-', ''), 'hist-uuid-1', 'pos-hist-1', 'cand-hist-2', 'voter-3', '2027-02-10 11:00:00');