Total Complexity | 7 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
15 | abstract class MongoMigration extends \Illuminate\Database\Migrations\Migration |
||
16 | { |
||
17 | protected $connection = 'mongodb'; |
||
18 | |||
19 | protected $collection; |
||
20 | |||
21 | /** |
||
22 | * MongoMigration constructor. |
||
23 | */ |
||
24 | public function __construct() |
||
25 | { |
||
26 | if (! isset($this->collection) || $this->collection === '') { |
||
27 | throw new InternalErrorException('Collection name must be specified on migration: '.get_called_class()); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | abstract protected function migrate(Blueprint $collection); |
||
32 | |||
33 | /** |
||
34 | * Run the migrations. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | final public function up() |
||
43 | }); |
||
44 | } |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Reverse the migrations. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | final public function down() |
||
59 |