Failed Conditions
Push — master ( 69b1a4...1d846b )
by Sam
04:50
created

Version20251105134353::up()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 21
ccs 0
cts 16
cp 0
rs 9.7666
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Migration;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
class Version20251105134353 extends AbstractMigration
11
{
12
    public function up(Schema $schema): void
13
    {
14
15
        // user.id => bookable_tag.id
16
        $map = [
17
            '11055' => '6004',
18
            '11056' => '6003',
19
            '11057' => '6001',
20
            '11058' => '6000',
21
            '11059' => '6005',
22
            '11060' => '6006',
23
            '11061' => '6043',
24
            '11062' => '6038',
25
        ];
26
27
        foreach ($map as $userId => $bookableTagId) {
28
            $this->addSql(
29
                "UPDATE bookable
30
                INNER JOIN bookable_tag_bookable btb ON bookable.id = btb.bookable_id
31
                SET bookable.owner_id = {$userId}
32
                WHERE btb.bookable_tag_id = {$bookableTagId}",
33
            );
34
        }
35
36
    }
37
}
38