Skip to content

Commit

Permalink
Merge pull request #78 from xmuntane/fix-remove-level_id-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmellor authored Apr 29, 2024
2 parents 735dd1e + 4631c02 commit fd54e24
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('level_id');
Schema::table(config('level-up.user.users_table'), function (Blueprint $table) {
$table->dropConstrainedForeignId('level_id');
});
}

public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->foreignId('level_id')->constrained();
Schema::table(config('level-up.user.users_table'), function (Blueprint $table) {
$table->foreignId('level_id')->nullable()->constrained();
});
}
};

0 comments on commit fd54e24

Please sign in to comment.