Added migration to create 'type' column for messages

This commit is contained in:
noah.lancien 2023-04-06 13:25:37 +00:00
parent 5fa24d69c8
commit 1aab655964

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddMessageType extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('messages', function (Blueprint $table) {
$table->integer('type')
->nullable()
->comment('Message Type defined by an enum.')
->after('message');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('messages', function (Blueprint $table) {
$table->dropColumn('type');
});
}
}