From 70547add629ea61224623cd29feb73e66ad45660 Mon Sep 17 00:00:00 2001 From: Rebecca Tinchon <58392030+WolfyWin@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:40:34 +0100 Subject: [PATCH] [Peertube] updater video controls (#2753) --- .../ClarolinePeerTubeInstaller.php | 8 +++++ .../Installation/Updater/Updater141000.php | 32 +++++++++++++++++++ .../peertube/Resources/config/services.yml | 1 + .../Resources/config/services/updater.yml | 7 ++++ 4 files changed, 48 insertions(+) create mode 100644 src/integration/peertube/Installation/Updater/Updater141000.php create mode 100644 src/integration/peertube/Resources/config/services/updater.yml diff --git a/src/integration/peertube/Installation/ClarolinePeerTubeInstaller.php b/src/integration/peertube/Installation/ClarolinePeerTubeInstaller.php index 4963cf51c3d..bac38054f41 100644 --- a/src/integration/peertube/Installation/ClarolinePeerTubeInstaller.php +++ b/src/integration/peertube/Installation/ClarolinePeerTubeInstaller.php @@ -3,6 +3,7 @@ namespace Claroline\PeerTubeBundle\Installation; use Claroline\InstallationBundle\Additional\AdditionalInstaller; +use Claroline\PeerTubeBundle\Installation\Updater\Updater141000; class ClarolinePeerTubeInstaller extends AdditionalInstaller { @@ -10,4 +11,11 @@ public function hasMigrations(): bool { return true; } + + public static function getUpdaters(): array + { + return [ + '14.1.0' => Updater141000::class, + ]; + } } diff --git a/src/integration/peertube/Installation/Updater/Updater141000.php b/src/integration/peertube/Installation/Updater/Updater141000.php new file mode 100644 index 00000000000..ab7aebc9d19 --- /dev/null +++ b/src/integration/peertube/Installation/Updater/Updater141000.php @@ -0,0 +1,32 @@ +connection = $connection; + } + + /** + * @throws Exception + */ + public function postUpdate(): void + { + $updateControls = $this->connection->prepare(' + UPDATE claro_peertube_video + AS ptv + SET ptv.controls = true + '); + + $updateControls->executeQuery(); + } +} diff --git a/src/integration/peertube/Resources/config/services.yml b/src/integration/peertube/Resources/config/services.yml index 900742f9e83..3c122861b90 100644 --- a/src/integration/peertube/Resources/config/services.yml +++ b/src/integration/peertube/Resources/config/services.yml @@ -4,3 +4,4 @@ imports: - { resource: services/serializer.yml } - { resource: services/subscriber.yml } - { resource: services/validator.yml } + - { resource: services/updater.yml } diff --git a/src/integration/peertube/Resources/config/services/updater.yml b/src/integration/peertube/Resources/config/services/updater.yml new file mode 100644 index 00000000000..c8672550b02 --- /dev/null +++ b/src/integration/peertube/Resources/config/services/updater.yml @@ -0,0 +1,7 @@ +services: + _defaults: + tags: [ 'claroline.platform.updater' ] + + Claroline\PeerTubeBundle\Installation\Updater\Updater141000: + arguments: + - '@doctrine.dbal.default_connection'