Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
SetupVersion_0003 | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
migrateIOSystem | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
migrateDatabase | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Setup\Versions; |
6 | |
7 | use PeServer\App\Models\Setup\DatabaseSetupArgument; |
8 | use PeServer\App\Models\Setup\IOSetupArgument; |
9 | |
10 | /** |
11 | * @SuppressWarnings(PHPMD.CamelCaseClassName) |
12 | */ |
13 | #[Version(3)] |
14 | class SetupVersion_0003 extends SetupVersionBase //phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps |
15 | { |
16 | #region SetupVersionBase |
17 | |
18 | protected function migrateIOSystem(IOSetupArgument $argument): void |
19 | { |
20 | //NOP |
21 | } |
22 | |
23 | protected function migrateDatabase(DatabaseSetupArgument $argument): void |
24 | { |
25 | $statements = <<<SQL |
26 | |
27 | create table |
28 | [pe_setting] |
29 | ( |
30 | [version] text not null |
31 | ) |
32 | ; |
33 | |
34 | insert into |
35 | [pe_setting] |
36 | ( |
37 | [version] |
38 | ) |
39 | values |
40 | ( |
41 | '0.00.000' |
42 | ) |
43 | |
44 | SQL; |
45 | |
46 | foreach ($this->splitStatements($statements) as $statement) { |
47 | $argument->default->execute($statement); |
48 | } |
49 | } |
50 | |
51 | #endregion |
52 | } |