diff --git a/drush.services.yml b/drush.services.yml new file mode 100644 index 0000000..226d11c --- /dev/null +++ b/drush.services.yml @@ -0,0 +1,5 @@ +services: + entity_activity_tracker.commands: + class: \Drupal\entity_activity_tracker\Commands\EntityActivityTrackerCommands + tags: + - { name: drush.command } diff --git a/src/Commands/EntityActivityTrackerCommands.php b/src/Commands/EntityActivityTrackerCommands.php new file mode 100644 index 0000000..3660209 --- /dev/null +++ b/src/Commands/EntityActivityTrackerCommands.php @@ -0,0 +1,43 @@ +listAll('entity_activity_tracker'); + $config_factory = \Drupal::configFactory(); + foreach ($config_names as $config) { + $config_factory->getEditable($config)->delete(); + } + + // Truncate entity_activity_tracker and clean up queue. + $database = \Drupal::database(); + $database->truncate('entity_activity_tracker')->execute(); + $database->delete('queue')->condition('name', 'activity_processor_queue')->execute(); + $database->delete('queue')->condition('name', 'tracker_processor_queue')->execute(); + } +}