Skip to content

Commit fcf3bbf

Browse files
authored
Merge pull request #199 from aroskanalen/feature/398_change_route_prefix_in_slide_content_field
398: Add doctrine migration to change media references from 'v1' to 'v2'
2 parents 4d91fe5 + 9b0a063 commit fcf3bbf

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#199](https://github.com/os2display/display-api-service/pull/199)
8+
- Add doctrine migration to change media references from API 'v1' to API 'v2' in slide content
79
- [#198](https://github.com/os2display/display-api-service/pull/198)
810
- Changed route prefix to v2.
911
- [#197](https://github.com/os2display/display-api-service/pull/197)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Update links to media in slide content field to match api version change.
12+
*/
13+
final class Version20240405092445 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return 'Update links to media in slide content field to match api version change';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
$this->addSql('UPDATE slide SET content = REPLACE(content, \'\\\/v1\\\/media\\\/\', \'\\\/v2\\\/media\\\/\')');
23+
}
24+
25+
public function down(Schema $schema): void
26+
{
27+
$this->addSql('UPDATE slide SET content = REPLACE(content, \'\\\/v2\\\/media\\\/\', \'\\\/v1\\\/media\\\/\')');
28+
}
29+
}

0 commit comments

Comments
 (0)