[MM-40952] migrations: Add if statements for some queries (#19359)

* migrations: add if statements for some queries

* add better checks to upgrade posts v6 migration

* use "is null" instead of "= null"

* fix down script for users v6

* reflect review comments
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-01-19 10:57:28 +03:00
коммит произвёл GitHub
родитель 509f49c813
Коммит 56c7da5817
18 изменённых файлов: 287 добавлений и 93 удалений

Просмотреть файл

@@ -18,7 +18,7 @@ SELECT count(*) != 0 INTO msg_count_root_exist
AND column_name = 'mentioncountroot';
IF mention_count_root_exist THEN
tmp_count_root := (SELECT count(*) FROM channelmembers WHERE msgcountroot = NULL OR mentioncountroot = NULL);
tmp_count_root := (SELECT count(*) FROM channelmembers WHERE msgcountroot IS NULL OR mentioncountroot IS NULL);
END IF;
ALTER TABLE channelmembers ADD COLUMN IF NOT EXISTS mentioncountroot bigint;