Jan Dittberner
70cc0942ca
- use embed from the standard library instead of packr - upgrade to sprig v3 - upgrade gomail version - use golang-migrate instead of sql-migrate to get embed support - use statigz to deliver compressed static assets
13 lines
421 B
SQL
13 lines
421 B
SQL
-- SQL in section 'Up' is executed when this migration is applied
|
|
CREATE TABLE user_roles
|
|
(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
voter_id VARCHAR(255) NOT NULL REFERENCES voters (id),
|
|
role VARCHAR(8) NOT NULL,
|
|
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE (voter_id, role)
|
|
);
|
|
INSERT INTO user_roles (voter_id, role)
|
|
SELECT id, 'VOTER'
|
|
FROM voters
|
|
WHERE enabled = true;
|