CreateHistoriesTable::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
 * Copyright (C) iFeras93, Inc - All Rights Reserved
4
 *
5
 *
6
 * @file        create_history_table.php.stub.php
7
 * @author      Firas
8
 * @project     HistoriableModel
9
 * @date        2/16/2020
10
 */
11
12
//namespace Iferas93\HistoriableModel\migrations;
13
14
use Illuminate\Database\Migrations\Migration;
15
use Illuminate\Database\Schema\Blueprint;
16
use Illuminate\Support\Facades\Schema;
17
18
class CreateHistoriesTable extends Migration
19
{
20
    /**
21
     * Run the migrations.
22
     *
23
     * @return void
24
     */
25
    public function up()
26
    {
27
        Schema::create('histories', function (Blueprint $table) {
28
            $table->bigIncrements('id');
29
            $table->morphs('historiable');
30
            $table->string('changed_column');
31
            $table->text('value_from')->nullable();
32
            $table->text('value_to')->nullable();
33
            $table->timestamps();
34
        });
35
    }
36
37
    /**
38
     * Reverse the migrations.
39
     *
40
     * @return void
41
     */
42
    public function down()
43
    {
44
        Schema::dropIfExists('histories');
45
    }
46
}
47