tenant: add member management APIs
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
-- tenant_users.status:历史上默认值为 'active',但代码枚举使用 UserStatus(pending_verify/verified/banned)。
|
||||
-- 为避免新增成员落入未知状态,这里将默认值调整为 'verified',并修正存量 'active' -> 'verified'。
|
||||
ALTER TABLE tenant_users
|
||||
ALTER COLUMN status SET DEFAULT 'verified';
|
||||
|
||||
UPDATE tenant_users
|
||||
SET status = 'verified'
|
||||
WHERE status = 'active';
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
-- 回滚:恢复默认值为 'active'(不回滚数据修正)。
|
||||
ALTER TABLE tenant_users
|
||||
ALTER COLUMN status SET DEFAULT 'active';
|
||||
-- +goose StatementEnd
|
||||
|
||||
Reference in New Issue
Block a user