38 lines
1.2 KiB
SQL
38 lines
1.2 KiB
SQL
-- Add personal privacy switch for requiring approval when others invite the user into a group.
|
|
-- Default is off to preserve existing behavior.
|
|
-- Run this for every tenant business database. The current test environment uses:
|
|
-- default -> tinode
|
|
-- system -> meeting_im
|
|
|
|
SET @im_schema = 'tinode';
|
|
SET @im_sql = (
|
|
SELECT IF(
|
|
COUNT(*) = 0,
|
|
CONCAT('ALTER TABLE ', @im_schema, '.im_user_privacy_settings ADD COLUMN group_invite_verification TINYINT NOT NULL DEFAULT 0 AFTER read_receipts'),
|
|
'SELECT 1'
|
|
)
|
|
FROM information_schema.columns
|
|
WHERE table_schema = @im_schema
|
|
AND table_name = 'im_user_privacy_settings'
|
|
AND column_name = 'group_invite_verification'
|
|
);
|
|
PREPARE im_stmt FROM @im_sql;
|
|
EXECUTE im_stmt;
|
|
DEALLOCATE PREPARE im_stmt;
|
|
|
|
SET @im_schema = 'meeting_im';
|
|
SET @im_sql = (
|
|
SELECT IF(
|
|
COUNT(*) = 0,
|
|
CONCAT('ALTER TABLE ', @im_schema, '.im_user_privacy_settings ADD COLUMN group_invite_verification TINYINT NOT NULL DEFAULT 0 AFTER read_receipts'),
|
|
'SELECT 1'
|
|
)
|
|
FROM information_schema.columns
|
|
WHERE table_schema = @im_schema
|
|
AND table_name = 'im_user_privacy_settings'
|
|
AND column_name = 'group_invite_verification'
|
|
);
|
|
PREPARE im_stmt FROM @im_sql;
|
|
EXECUTE im_stmt;
|
|
DEALLOCATE PREPARE im_stmt;
|