From 0153cb33dede09a0167d490204bdf10151ed15cc Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 1 Dec 2017 11:54:02 -0800 Subject: Add command to remove project activities after one year --- app/Console/BaseCommand.php | 1 + app/Console/ProjectActivityArchiveCommand.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/Console/ProjectActivityArchiveCommand.php (limited to 'app/Console') diff --git a/app/Console/BaseCommand.php b/app/Console/BaseCommand.php index 09059ecf..8ea67ae4 100644 --- a/app/Console/BaseCommand.php +++ b/app/Console/BaseCommand.php @@ -18,6 +18,7 @@ use Symfony\Component\Console\Command\Command; * @property \Kanboard\Export\TransitionExport $transitionExport * @property \Kanboard\Model\NotificationModel $notificationModel * @property \Kanboard\Model\ProjectModel $projectModel + * @property \Kanboard\Model\ProjectActivityModel $projectActivityModel * @property \Kanboard\Model\ProjectPermissionModel $projectPermissionModel * @property \Kanboard\Model\ProjectDailyColumnStatsModel $projectDailyColumnStatsModel * @property \Kanboard\Model\ProjectDailyStatsModel $projectDailyStatsModel diff --git a/app/Console/ProjectActivityArchiveCommand.php b/app/Console/ProjectActivityArchiveCommand.php new file mode 100644 index 00000000..18a4d7d7 --- /dev/null +++ b/app/Console/ProjectActivityArchiveCommand.php @@ -0,0 +1,21 @@ +setName('projects:archive-activities') + ->setDescription('Remove project activities after one year'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->projectActivityModel->cleanup(strtotime('-1 year')); + } +} -- cgit v1.2.3