CreateEarlyAccessTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateEarlyAccessTable extends Migration
8
{
9
    /**
10
     * @var string
11
     */
12
    private $table;
13
14
    /**
15
     * CreateEarlyAccessTable constructor.
16
     */
17
    public function __construct()
18
    {
19
        $this->table = config('early-access.services.database.table_name');
20
    }
21
22
    /**
23
     * Run the migrations.
24
     *
25
     * @return void
26
     */
27
    public function up()
28
    {
29
        Schema::create($this->table, function (Blueprint $table) {
30
            $table->increments('id');
31
            $table->string('name')->nullable();
32
            $table->string('email');
33
            $table->dateTime('subscribed_at')->nullable();
34
            $table->dateTime('verified_at')->nullable();
35
            $table->softDeletes();
36
37
            $table->unique(['email', 'deleted_at']);
38
        });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        Schema::dropIfExists($this->table);
49
    }
50
}
51