Files
Friendship-and-chat-im/db/member-user-sync-20261109.sql
T

9 lines
626 B
SQL

-- Run once during the maintenance window, before deploying the new IM services.
ALTER TABLE im_user
ADD COLUMN member_state TINYINT NOT NULL DEFAULT 0 COMMENT '0 active, 1 disabled, 2 deleted, 3 orphan',
ADD COLUMN sync_version BIGINT NOT NULL DEFAULT 0 COMMENT 'Applied business profile version',
ADD COLUMN auth_version BIGINT NOT NULL DEFAULT 0 COMMENT 'Monotonic token revocation generation',
ADD COLUMN access_disabled TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Last effective member/IM-ban restriction';
UPDATE im_user SET access_disabled = 1, auth_version = GREATEST(auth_version, 1) WHERE is_banned = 1;