Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Migration | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| setDatabase | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDatabase | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| up | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| down | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| 1 | <?php declare(strict_types=1); |
| 2 | /* |
| 3 | * This file is part of Aplus Framework Database Extra Library. |
| 4 | * |
| 5 | * (c) Natan Felles <natanfelles@gmail.com> |
| 6 | * |
| 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | * file that was distributed with this source code. |
| 9 | */ |
| 10 | namespace Framework\Database\Extra; |
| 11 | |
| 12 | use Framework\Database\Database; |
| 13 | |
| 14 | /** |
| 15 | * Class Migration. |
| 16 | * |
| 17 | * @package database-extra |
| 18 | */ |
| 19 | abstract class Migration |
| 20 | { |
| 21 | protected Database $database; |
| 22 | |
| 23 | public function setDatabase(Database $database) : static |
| 24 | { |
| 25 | $this->database = $database; |
| 26 | return $this; |
| 27 | } |
| 28 | |
| 29 | public function getDatabase() : Database |
| 30 | { |
| 31 | return $this->database; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Run migration up. |
| 36 | */ |
| 37 | abstract public function up() : void; |
| 38 | |
| 39 | /** |
| 40 | * Run migration down. |
| 41 | */ |
| 42 | abstract public function down() : void; |
| 43 | } |