Code Duplication    Length = 14-16 lines in 3 locations

database/migrations/2019_10_27_012545_create_subscriptions_tables.php 3 locations

@@ 16-29 (lines=14) @@
13
     */
14
    public function up()
15
    {
16
        Schema::create('plans', function (Blueprint $table) {
17
            $table->engine = 'InnoDB';
18
19
            $table->increments('id');
20
            $table->string('name');
21
            $table->text('description')->nullable();
22
            $table->string('group', 100)->nullable();
23
            $table->integer('free_days')->default(0);
24
            $table->tinyInteger('sort_order');
25
            $table->boolean('is_active')->default(0);
26
            $table->boolean('is_default')->default(0);
27
28
            $table->timestamps();
29
        });
30
31
        Schema::create('plan_prices', function (Blueprint $table) {
32
            $table->engine = 'InnoDB';
@@ 46-61 (lines=16) @@
43
            $table->timestamps();
44
        });
45
46
        Schema::create('plan_features', function (Blueprint $table) {
47
            $table->engine = 'InnoDB';
48
49
            $table->increments('id');
50
            $table->integer('plan_id')->unsigned();
51
            $table->string('code', 100);
52
            $table->integer('value')->default(0);
53
            $table->integer('sort_order');
54
            $table->boolean('is_consumable')->default(0);
55
56
            $table->foreign('plan_id')
57
                ->references('id')->on('plans');
58
59
            $table->timestamps();
60
        });
61
62
        Schema::create('subscriptions', function (Blueprint $table) {
63
            $table->engine = 'InnoDB';
64
@@ 81-96 (lines=16) @@
78
            $table->timestamps();
79
        });
80
81
        Schema::create('subscriber_consumables', function (Blueprint $table) {
82
            $table->engine = 'InnoDB';
83
84
            $table->increments('id');
85
            $table->integer('plan_feature_id')->unsigned();
86
            $table->string('subscriber_type');
87
            $table->integer('subscriber_id');
88
            $table->integer('available')->nullable();
89
            $table->integer('used')->nullable();
90
91
            $table->foreign('plan_feature_id')
92
                ->references('id')->on('plans_features');
93
94
            $table->timestamps();
95
        });
96
    }
97
98
    /**
99
     * Reverse the migrations.