Closed lebedevsergey closed 2 years ago
Hi Sergey! Using debug_backtrace is not the best choice. Maybe exist more direct way to detect pretend mode? Like detect option from cli params or use laravel environment?
I tried to find another solution but didn't find.
I modified your PR a little. Check out the latest tag, v1.15.4.
Thanks for your contribution.
Hello! Thank you for adopting my PR!
I agree that it is a bit too low level approach to use debug_backtrace
for detecting pretend
mode which could lead to incompatibility with future Laravel
version. Though with the current architecture (when Clickhouse
migrations use static write
method defined in Migration
class) it is difficult to find other method to check for pretend
mode.
In Laravel there is migration pretend mode, when migration is not really applied but shows SQL that will be applied. However this mode is not supported by
phpclickhouse-laravel
. This can cause issues when user launches DB-migrations withartisan migrate --pretend
and expects that migrations will be applied but only shown. So I added the support for pretend mode.