feat(store): add totp columns, org totp policy and global scope
Orgs are created inside their own tenant scope, so signup needs no system scope. Refs #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
caff396264
commit
99e9b1e57d
12 files changed
+203
-31
No files matched your search
@@ -0,0 +1,14 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE users
|
||||
ADD COLUMN totp_secret bytea,
|
||||
ADD COLUMN totp_enabled_at timestamptz,
|
||||
ADD CONSTRAINT users_totp_consistent CHECK ((totp_secret IS NULL) = (totp_enabled_at IS NULL));
|
||||
|
||||
ALTER TABLE orgs ADD COLUMN require_totp boolean NOT NULL DEFAULT false;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE orgs DROP COLUMN require_totp;
|
||||
ALTER TABLE users
|
||||
DROP CONSTRAINT users_totp_consistent,
|
||||
DROP COLUMN totp_enabled_at,
|
||||
DROP COLUMN totp_secret;
|
||||
Reference in new issue
Block a user