Add an "activated" field in the user table
This commit is contained in:
parent
f6ad0dc85e
commit
9aebee2c4a
@ -1,2 +1,2 @@
|
|||||||
INSERT INTO users (name, hash, admin) VALUES ('test', '$2a$10$QHx07iyuxO1RcehgtjMgjOzv03Bx2eeSKvsxkoj9oR2NJ4cklh6ue', false);
|
INSERT INTO users (name, hash, admin, activated) VALUES ('test', '$2a$10$QHx07iyuxO1RcehgtjMgjOzv03Bx2eeSKvsxkoj9oR2NJ4cklh6ue', false, true);
|
||||||
INSERT INTO users (name, hash, admin) VALUES ('admin', '$2a$10$qAbyDZsHtcnhXhjhQZkD2uKlX72eMHsX8Hi2Cnl1vJUqHQiey2qa6', true);
|
INSERT INTO users (name, hash, admin, activated) VALUES ('admin', '$2a$10$qAbyDZsHtcnhXhjhQZkD2uKlX72eMHsX8Hi2Cnl1vJUqHQiey2qa6', true, true);
|
||||||
|
1
sql/migration/0005__user_activation.down.sql
Normal file
1
sql/migration/0005__user_activation.down.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE users DROP COLUMN activated;
|
3
sql/migration/0005__user_activation.up.sql
Normal file
3
sql/migration/0005__user_activation.up.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE users ADD COLUMN activated boolean NOT NULL DEFAULT false;
|
||||||
|
UPDATE users SET activated = true;
|
||||||
|
CREATE INDEX ON users (activated);
|
@ -44,6 +44,7 @@ type User struct {
|
|||||||
Name string
|
Name string
|
||||||
Hash string
|
Hash string
|
||||||
Admin bool
|
Admin bool
|
||||||
|
Activated bool
|
||||||
RawConfig types.JSONText
|
RawConfig types.JSONText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user