Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to edit existing migration when new migration does the change?

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public function up(): void
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->string('provider');
$table->string('provider_user_id');
$table->string('provider_token')->nullable();
$table->string('provider_refresh_token')->nullable();
$table->text('provider_token')->nullable();
$table->text('provider_refresh_token')->nullable();
$table->timestamps();

$table->unique(['provider', 'provider_user_id']);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

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

return new class extends Migration
{
public function up(): void
{
Schema::table('social_logins', function (Blueprint $table) {
$table->text('provider_token')->nullable()->change();
$table->text('provider_refresh_token')->nullable()->change();
});
}

public function down(): void
{
Schema::table('social_logins', function (Blueprint $table) {
$table->string('provider_token')->nullable()->change();
$table->string('provider_refresh_token')->nullable()->change();
});
}
};
Loading