Code Duplication    Length = 16-16 lines in 6 locations

src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToBotanShortenerTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'botan_shortener', static function (Blueprint $table) {
13
            $table->foreign('user_id', config('phptelegrambot.database.prefix', '') . 'botan_shortener_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'botan_shortener', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'botan_shortener_ibfk_1');
21
        });
22
    }
23
}
24

src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToChosenInlineResultTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'chosen_inline_result', static function (Blueprint $table) {
13
            $table->foreign('user_id', config('phptelegrambot.database.prefix', '') . 'chosen_inline_result_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'chosen_inline_result', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'chosen_inline_result_ibfk_1');
21
        });
22
    }
23
}
24

src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToInlineQueryTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'inline_query', static function (Blueprint $table) {
13
            $table->foreign('user_id', config('phptelegrambot.database.prefix', '') . 'inline_query_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'inline_query', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'inline_query_ibfk_1');
21
        });
22
    }
23
}
24

src/database/migrations/2020_05_18_123462_add_foreign_keys_to_poll_answer_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToPollAnswerTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'poll_answer', static function (Blueprint $table) {
13
            $table->foreign('poll_id', config('phptelegrambot.database.prefix', '') . 'poll_answer_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'poll')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'poll_answer', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'poll_answer_ibfk_1');
21
        });
22
    }
23
}
24

src/database/migrations/2020_05_18_123463_add_foreign_keys_to_pre_checkout_query_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToPreCheckoutQueryTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'pre_checkout_query', static function (Blueprint $table) {
13
            $table->foreign('user_id', config('phptelegrambot.database.prefix', '') . 'pre_checkout_query_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'pre_checkout_query', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'pre_checkout_query_ibfk_1');
21
        });
22
    }
23
}
24

src/database/migrations/2020_05_18_123464_add_foreign_keys_to_shipping_query_table.php 1 location

@@ 8-23 (lines=16) @@
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AddForeignKeysToShippingQueryTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::table(config('phptelegrambot.database.prefix', '') . 'shipping_query', static function (Blueprint $table) {
13
            $table->foreign('user_id', config('phptelegrambot.database.prefix', '') . 'shipping_query_ibfk_1')->references('id')->on(config('phptelegrambot.database.prefix', '') . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
14
        });
15
    }
16
17
    public function down()
18
    {
19
        Schema::table(config('phptelegrambot.database.prefix', '') . 'shipping_query', static function (Blueprint $table) {
20
            $table->dropForeign(config('phptelegrambot.database.prefix', '') . 'shipping_query_ibfk_1');
21
        });
22
    }
23
}
24