MM-67510 Drop deprecated autotranslation column from ChannelMembers (#37496)

This commit is contained in:
Jesse Hallam
2026-08-18 11:03:05 +00:00
committed by GitHub
parent 95fc4743df
commit dc6ab54f82
5 changed files with 27 additions and 0 deletions
@@ -421,3 +421,7 @@ channels/db/migrations/postgres/000212_add_scheduled_post_recurrence.down.sql
channels/db/migrations/postgres/000212_add_scheduled_post_recurrence.up.sql
channels/db/migrations/postgres/000213_add_scheduled_post_pending_index.down.sql
channels/db/migrations/postgres/000213_add_scheduled_post_pending_index.up.sql
channels/db/migrations/postgres/000214_drop_channelmembers_autotranslation.down.sql
channels/db/migrations/postgres/000214_drop_channelmembers_autotranslation.up.sql
channels/db/migrations/postgres/000215_drop_channelmembers_autotranslation_column.down.sql
channels/db/migrations/postgres/000215_drop_channelmembers_autotranslation_column.up.sql
@@ -0,0 +1,8 @@
-- morph:nontransactional
-- Recreate the partial index on the channelmembers autotranslation column,
-- mirroring migration 000147. Runs after 000215 restores the column.
-- CONCURRENTLY cannot run inside a transaction, so this must be the only
-- statement in the file.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_channelmembers_autotranslation_enabled
ON channelmembers (channelid)
WHERE autotranslation = true;
@@ -0,0 +1,5 @@
-- morph:nontransactional
-- Drop the partial index on the deprecated channelmembers autotranslation
-- column ahead of dropping the column itself in 000215. CONCURRENTLY cannot run
-- inside a transaction, so this must be the only statement in the file.
DROP INDEX CONCURRENTLY IF EXISTS idx_channelmembers_autotranslation_enabled;
@@ -0,0 +1,5 @@
-- Recreate the deprecated channelmembers autotranslation column, mirroring
-- migration 000147. Prior values are not restorable. The partial index is
-- recreated separately in 000214.
ALTER TABLE channelmembers
ADD COLUMN IF NOT EXISTS autotranslation boolean NOT NULL DEFAULT false;
@@ -0,0 +1,5 @@
-- Drop the deprecated channelmembers autotranslation column (opt-in semantics),
-- replaced by autotranslationdisabled (opt-out) in migration 000151. The partial
-- index on this column is dropped separately in 000214.
ALTER TABLE channelmembers
DROP COLUMN IF EXISTS autotranslation;