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

40 lines
2.8 KiB
SQL

-- Update sample voters with grade level, track, and section
UPDATE users SET grade_level = 11, track = 'STEM', section = 'A' WHERE id = 'voter-1';
UPDATE users SET grade_level = 11, track = 'STEM', section = 'B' WHERE id = 'voter-2';
UPDATE users SET grade_level = 11, track = 'ABM', section = 'C' WHERE id = 'voter-3';
UPDATE users SET grade_level = 12, track = 'ABM', section = 'D' WHERE id = 'voter-4';
UPDATE users SET grade_level = 12, track = 'HUMSS', section = 'E' WHERE id = 'voter-5';
UPDATE users SET grade_level = 12, track = 'HUMSS', section = 'F' WHERE id = 'voter-6';
UPDATE users SET grade_level = 11, track = 'GAS', section = 'G' WHERE id = 'voter-7';
UPDATE users SET grade_level = 12, track = 'TVL', section = 'H' WHERE id = 'voter-8';
-- Insert some dummy votes so the charts aren't empty
-- We need to find the position and candidate IDs
-- President candidates: cand-1, cand-2, cand-5, cand-7, cand-9, cand-11, cand-13, cand-15
-- Vice President candidates: cand-3, cand-4, cand-6, cand-8, cand-10, cand-12, cand-14
-- voter-1 votes for cand-1 (President)
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-1', 'voter-1', '2026-02-11 10:00:00');
-- voter-2 votes for cand-2
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-2', 'voter-2', '2026-02-12 11:00:00');
-- voter-3 votes for cand-1
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-1', 'voter-3', '2026-02-13 09:00:00');
-- voter-4 votes for cand-5
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-5', 'voter-4', '2026-02-14 10:00:00');
-- voter-5 votes for cand-7
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-7', 'voter-5', '2026-02-15 11:00:00');
-- voter-6 votes for cand-1
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-1', 'voter-6', '2026-02-15 12:00:00');
-- voter-7 votes for cand-9
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-9', 'voter-7', '2026-02-15 13:00:00');
-- voter-8 votes for cand-11
INSERT INTO votes (id, election_id, position_id, candidate_id, voter_id, casted_at)
VALUES (REPLACE(UUID(), '-', ''), 'sample-election-uuid', 'pos-1', 'cand-11', 'voter-8', '2026-02-15 14:00:00');