CreateHistoriesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 11 1
A down() 0 4 1
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