Skip to content

Commit

Permalink
feat(database): make 'title' column nullable in projects table
Browse files Browse the repository at this point in the history
- Add new migration to modify 'title' column
- Allow NULL values for project titles
- Resolve integrity constraint violation issue
- Maintain backwards compatibility with existing data
  • Loading branch information
Abdoulrachard committed Nov 15, 2024
1 parent 623b6e0 commit 35eb817
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('projects', function (Blueprint $table) {
$table->string('title')->nullable()->change();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('projects', function (Blueprint $table) {
$table->string('title')->nullable(false)->change();
});
}
};

0 comments on commit 35eb817

Please sign in to comment.