Added migration to create 'type' column for messages
This commit is contained in:
parent
5fa24d69c8
commit
1aab655964
1 changed files with 35 additions and 0 deletions
35
database/migrations/2023_04_06_122125_add_message_type.php
Normal file
35
database/migrations/2023_04_06_122125_add_message_type.php
Normal 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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue