for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class UpdateEditedMessageTable extends Migration
{
public function up ()
Schema::table(config('phptelegrambot.database.prefix', '') . 'edited_message', static function (Blueprint $table) {
$table->dropForeign (config('phptelegrambot.database.prefix', '') . 'edited_message_ibfk_2');
$table->foreign (
['chat_id', 'message_id'],
config('phptelegrambot.database.prefix', '') . 'edited_message_ibfk_2'
)
->references (['chat_id', 'id'])->on (config('phptelegrambot.database.prefix', '') . 'message')
->onUpdate('RESTRICT')->onDelete('RESTRICT');
});
}
public function down ()
$table->foreign ('chat_id', config('phptelegrambot.database.prefix', '') . 'edited_message_ibfk_2')
->references ('chat_id')->on (config('phptelegrambot.database.prefix', '') . 'message')