|
| 1 | +/* Copyright 2022 The Matrix.org Foundation C.I.C |
| 2 | + * |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. |
| 5 | + * You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +INSERT INTO background_updates (ordering, update_name, progress_json, depends_on) VALUES |
| 17 | + -- Set up user directory staging tables. |
| 18 | + (7322, 'populate_user_directory_createtables', '{}', NULL), |
| 19 | + -- Run through each room and update the user directory according to who is in it. |
| 20 | + (7322, 'populate_user_directory_process_rooms', '{}', 'populate_user_directory_createtables'), |
| 21 | + -- Insert all users into the user directory, if search_all_users is on. |
| 22 | + (7322, 'populate_user_directory_process_users', '{}', 'populate_user_directory_process_rooms'), |
| 23 | + -- Clean up user directory staging tables. |
| 24 | + (7322, 'populate_user_directory_cleanup', '{}', 'populate_user_directory_process_users'), |
| 25 | + -- Rebuild the room_stats_current and room_stats_state tables. |
| 26 | + (7322, 'populate_stats_process_rooms', '{}', NULL), |
| 27 | + -- Update the user_stats_current table. |
| 28 | + (7322, 'populate_stats_process_users', '{}', NULL) |
| 29 | +ON CONFLICT (update_name) DO NOTHING; |
0 commit comments