From a968aef4ab034477f74eb5e77a4ee84c66f4cb7b Mon Sep 17 00:00:00 2001 From: Edmund Dunn <109987005+edmund-dunn@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:46:51 -0800 Subject: [PATCH] =?UTF-8?q?VACMS-20092:=20db=20update=20to=20truncate=20ta?= =?UTF-8?q?ble,=20uninstall=20danse=20modules=20an=20=E2=80=A6=20(#20118)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * VACMS-20092: db update to truncate table, uninstall danse modules an remove borked view * VACMS-20092: fixed spacing * VACMS-20092: fixed phpcs error --- config/sync/core.extension.yml | 2 -- .../views.view.danse_user_notifications.yml | 6 ------ .../modules/custom/va_gov_db/va_gov_db.install | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 config/sync/views.view.danse_user_notifications.yml diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 56c4a983e7..db1349c19f 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -48,8 +48,6 @@ module: csv_serialization: 0 ctools: 0 ctools_block: 0 - danse: 0 - danse_content_moderation: 0 datetime: 0 datetime_range: 0 dblog: 0 diff --git a/config/sync/views.view.danse_user_notifications.yml b/config/sync/views.view.danse_user_notifications.yml deleted file mode 100644 index 1714f02d07..0000000000 --- a/config/sync/views.view.danse_user_notifications.yml +++ /dev/null @@ -1,6 +0,0 @@ -display: - default: - display_options: - access: - type: danse_own_user - options: { } diff --git a/docroot/modules/custom/va_gov_db/va_gov_db.install b/docroot/modules/custom/va_gov_db/va_gov_db.install index 1a7cf1e329..b94b27d4e0 100644 --- a/docroot/modules/custom/va_gov_db/va_gov_db.install +++ b/docroot/modules/custom/va_gov_db/va_gov_db.install @@ -1166,3 +1166,20 @@ function va_gov_db_update_9015(&$sandbox) { 'va_gov_github', ]); } + +/** + * Truncate danse events table, remove broken view and uninstall danse modules. + */ +function va_gov_db_update_10001(): string { + // Remove the danse_event table. + Drupal::database()->truncate('danse_event')->execute(); + Drupal::logger('va_gov_backend')->log(LogLevel::INFO, 'danse_event table truncated.'); + // Remove the broken danse_user_notifications view. + Drupal::service('config.factory')->getEditable('views.view.danse_user_notifications')->delete(); + Drupal::logger('va_gov_backend')->log(LogLevel::INFO, 'Deleted danse_user_notifications view.'); + $uninstall_modules = [ + 'danse', + 'danse_content_moderation', + ]; + return _va_gov_db_uninstall_modules($uninstall_modules); +}