Skip to content

Commit

Permalink
default value for opening_date
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyNadd committed Dec 14, 2024
1 parent 55b9823 commit 07fbf2b
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('messages', function (Blueprint $table) {
$table->timestamp('opening_date')->default(DB::raw('CURRENT_TIMESTAMP'))->change();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('messages', function (Blueprint $table) {
//
});
}
};

0 comments on commit 07fbf2b

Please sign in to comment.