-
Notifications
You must be signed in to change notification settings - Fork 11.6k
[12.X] Add connection information in the migration output. #56791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12.x
Are you sure you want to change the base?
Conversation
Test needs to be updated. |
@crynobone yes I know. But my knowledge of working on framework is very limited. I have a lot of experience with the framework. If you want we can hop on a call to work on this PR? DM me on twitter If not, this PR can be deleted. |
@crynobone @kachelle if you want I can take a look to try to work on the tests for this |
Thanks @WendellAdriel , if needed contact me (twitter), I'm happy to assist/learn. |
{ | ||
if (! $this->repositoryExists()) { | ||
$this->components->info('Preparing database.'); | ||
$this->components->info('Preparing '.$this->migrator->resolveConnection($this->option('database'))->getDriverName().' database.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->components->info('Preparing '.$this->migrator->resolveConnection($this->option('database'))->getDriverName().' database.'); | |
$this->components->info(sprintf( | |
'Preparing %s database.', | |
$this->migrator->resolveConnection($this->option('database'))->getDriverName() | |
)); |
@kachelle Update the file: Below the first line of this method: $params = [$migrator = m::mock(Migrator::class), $dispatcher = m::mock(Dispatcher::class)]; Add these two lines: $connectionMock = m::mock(Connection::class);
$connectionMock->shouldReceive('getDriverName')->andReturn('sqlite'); Then below this line: $migrator->shouldReceive('hasRunAnyMigrations')->andReturn(true); Add this line: $migrator->shouldReceive('resolveConnection')->andReturn($connectionMock); This should fix the test. |
Thanks @WendellAdriel , I don't have time this week to work on this. Next week I look into this! |
Output before:
After this pr:
Reason:
Lost some time because my migrations were successfull on Cloud, but no data was in my remote database.
Because they ran on a
sqlite
db. Because the default value forDB_CONNECTION
is set to that.My first PR, please let me know if things should be done differently.