1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
Olivier Wilkinson (reivilibre) 636223108d Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2023-03-31 10:49:11 +01:00
Olivier Wilkinson (reivilibre) 70fd93a7f6 Move DROP INDEX to after ALTER .. SET NOT NULL 2023-03-31 10:47:42 +01:00
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
Make the `thread_id` column on `event_push_actions`, `event_push_actions_staging`, and `event_push_summary` non-null.
@@ -13,11 +13,13 @@
* limitations under the License.
*/
-- Drop the indexes used to find null thread_ids.
DROP INDEX IF EXISTS event_push_actions_thread_id_null;
DROP INDEX IF EXISTS event_push_summary_thread_id_null;
-- The thread_id columns can now be made non-nullable.
ALTER TABLE event_push_actions_staging ALTER COLUMN thread_id SET NOT NULL;
ALTER TABLE event_push_actions ALTER COLUMN thread_id SET NOT NULL;
ALTER TABLE event_push_summary ALTER COLUMN thread_id SET NOT NULL;
-- Drop the indexes used to find null thread_ids.
-- Only do this *after* the ALTER because the indices may be useful for validating
-- the NOT NULL constraint.
DROP INDEX IF EXISTS event_push_actions_thread_id_null;
DROP INDEX IF EXISTS event_push_summary_thread_id_null;