string('auth_method', 20)->default('password'); $table->foreignId('google_oauth_connection_id') ->nullable() ->constrained('google_oauth_connections') ->nullOnDelete(); }); } if (!Schema::hasColumn('sender_accounts', 'auth_method')) { Schema::table('sender_accounts', function (Blueprint $table) { $table->string('auth_method', 20)->default('password'); $table->foreignId('google_oauth_connection_id') ->nullable() ->constrained('google_oauth_connections') ->nullOnDelete(); }); } } public function down(): void { Schema::table('email_settings', function (Blueprint $table) { if (Schema::hasColumn('email_settings', 'google_oauth_connection_id')) { $table->dropForeign(['google_oauth_connection_id']); } if (Schema::hasColumn('email_settings', 'auth_method')) { $table->dropColumn(['auth_method', 'google_oauth_connection_id']); } }); Schema::table('sender_accounts', function (Blueprint $table) { if (Schema::hasColumn('sender_accounts', 'google_oauth_connection_id')) { $table->dropForeign(['google_oauth_connection_id']); } if (Schema::hasColumn('sender_accounts', 'auth_method')) { $table->dropColumn(['auth_method', 'google_oauth_connection_id']); } }); } };