Passed
Push — master ( 58f2a7...57b220 )
by Jakub
06:37
created

Notifications   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 14
c 1
b 0
f 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 14 1
1
<?php
2
declare(strict_types=1);
3
4
use Phinx\Migration\AbstractMigration;
5
6
final class Notifications extends AbstractMigration {
7
  public function change(): void {
8
    $this->table("users")
9
      ->addColumn("notifications", "boolean", ["default" => false,])
10
      ->update();
11
    $this->table("notifications")
12
      ->addColumn("title", "text")
13
      ->addColumn("body", "text")
14
      ->addColumn("icon", "text", ["null" => true,])
15
      ->addColumn("tag", "text")
16
      ->addColumn("target_url", "text", ["null" => true,])
17
      ->addColumn("user", "integer")
18
      ->addColumn("created", "integer")
19
      ->addForeignKey("user", "users")
20
      ->create();
21
  }
22
}
23
?>