Skip to content

Commit

Permalink
chore: make migrations suitable for backward compatibility for laravel 6
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Jul 18, 2024
1 parent b49af54 commit 4321164
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use WatheqAlshowaiter\ModelRequiredFields\Constants;
use Illuminate\Support\Facades\App;

class CreateFathersTable extends Migration
{
public function up(): void
{
Schema::create('fathers', function (Blueprint $table) {
$table->id(); // primary key -> ignored
if ((float) App::version() >= Constants::VERSION_AFTER_ID_METHOD_SUPPORT) {
$table->id(); // primary key -> ignored
} else {
$table->bigIncrements('id'); // primary key -> ignored
}
$table->boolean('active')->default(false); // default => ignored
$table->string('name'); // required
$table->string('email'); // required
Expand Down

0 comments on commit 4321164

Please sign in to comment.