Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
SetupVersion_0002 | |
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(2)] |
14 | class SetupVersion_0002 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 | [crash_reports] |
29 | ( |
30 | [sequence] integer not null, |
31 | |
32 | [timestamp] datetime not null, |
33 | [ip_address] text not null, |
34 | |
35 | [version] text not null, |
36 | [revision] text not null, |
37 | [build] text not null, |
38 | [user_id] text not null, |
39 | |
40 | [exception] text not null, |
41 | |
42 | [email] text not null, -- メールアドレス(暗号化) |
43 | [comment] text not null, |
44 | |
45 | [report] blob not null, |
46 | |
47 | primary key([sequence] autoincrement) |
48 | ) |
49 | ; |
50 | |
51 | create table |
52 | [feedbacks] |
53 | ( |
54 | [sequence] integer not null, |
55 | |
56 | [timestamp] datetime not null, |
57 | [ip_address] text not null, |
58 | |
59 | [version] text not null, |
60 | [revision] text not null, |
61 | [build] text not null, |
62 | [user_id] text not null, |
63 | |
64 | [first_execute_timestamp] text not null, |
65 | [first_execute_version] text not null, |
66 | |
67 | [process] text not null, |
68 | [platform] text not null, |
69 | [os] text not null, |
70 | [clr] text not null, |
71 | |
72 | [kind] text not null, |
73 | [subject] text not null, |
74 | [content] text not null, |
75 | |
76 | primary key([sequence] autoincrement) |
77 | ) |
78 | ; |
79 | |
80 | SQL; |
81 | |
82 | foreach ($this->splitStatements($statements) as $statement) { |
83 | $argument->default->execute($statement); |
84 | } |
85 | } |
86 | |
87 | #endregion |
88 | } |