Skip to content

Commit 5870bcd

Browse files
author
Andrey Helldar
authored
Merge pull request #22 from TheDragonCode/3.x
Added `dragon-code/support` 6 support, removed PHP < 8.0 support
2 parents ae68a56 + 40b904f commit 5870bcd

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

.github/workflows/laravel-8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [ "7.3", "7.4", "8.0", "8.1" ]
12+
php: [ "8.0", "8.1" ]
1313
laravel: [ "8.0" ]
1414
psql: [ "9", "10", "11", "12", "13", "14" ]
1515

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"source": "https://github.com/TheDragonCode/migrate-db"
2525
},
2626
"require": {
27-
"php": "^7.3 || ^8.0",
27+
"php": "^8.0",
2828
"ext-pdo": "*",
29-
"doctrine/dbal": "^2.6 || ^3.0",
29+
"doctrine/dbal": "^3.0",
3030
"dragon-code/contracts": "^2.15",
31-
"dragon-code/support": "^5.6",
31+
"dragon-code/support": "^6.0",
3232
"illuminate/contracts": "^8.0 || ^9.0",
3333
"illuminate/database": "^8.0 || ^9.0",
3434
"illuminate/support": "^8.0 || ^9.0"
@@ -38,7 +38,7 @@
3838
"ext-pdo_pgsql": "*",
3939
"mockery/mockery": "^1.0",
4040
"orchestra/testbench": "^6.0 || ^7.0",
41-
"phpunit/phpunit": "^9.0"
41+
"phpunit/phpunit": "^9.5"
4242
},
4343
"minimum-stability": "stable",
4444
"prefer-stable": true,

src/Console/Migrate.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
class Migrate extends Command
1717
{
1818
protected $signature = 'db:migrate'
19-
. ' {--schema-from= : Source connection name}'
20-
. ' {--schema-to= : Target connection name}'
21-
. ' {--exclude=* : Comma separated table names to exclude}'
22-
. ' {--tables=* : Comma separated table names to migrate only}';
19+
. ' {--schema-from= : Source connection name}'
20+
. ' {--schema-to= : Target connection name}'
21+
. ' {--exclude=* : Comma separated table names to exclude}'
22+
. ' {--tables=* : Comma separated table names to migrate only}';
2323

2424
protected $description = 'Data transfer from one database to another';
2525

@@ -144,7 +144,7 @@ function ($query) use ($table, $column) {
144144
)
145145
->orderBy($column)
146146
->chunk(1000, function (Collection $items) use ($table) {
147-
$items = Arr::toArray($items);
147+
$items = Arr::resolve($items);
148148

149149
$this->builder($this->target(), $table)->insert($items);
150150
});
@@ -301,7 +301,7 @@ protected function resolveBuilders(): void
301301

302302
protected function resolveOptions(): void
303303
{
304-
$this->tables = $this->getTablesOption();
304+
$this->tables = $this->getTablesOption();
305305
$this->excludes = $this->getExcludeOption();
306306

307307
if (empty($this->tables) && $this->confirmTableListOption()) {

tests/Unit/MysqlToMysqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected function tableData(string $connection, string $table): array
274274
{
275275
$items = DB::connection($connection)->table($table)->get();
276276

277-
return Arr::toArray($items);
277+
return Arr::resolve($items);
278278
}
279279

280280
protected function defaultSourceConnectionName(): string

tests/Unit/MysqlToPostgresTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected function tableData(string $connection, string $table): array
274274
{
275275
$items = DB::connection($connection)->table($table)->get();
276276

277-
return Arr::toArray($items);
277+
return Arr::resolve($items);
278278
}
279279

280280
protected function defaultSourceConnectionName(): string

tests/Unit/PostgresToMysqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected function tableData(string $connection, string $table): array
274274
{
275275
$items = DB::connection($connection)->table($table)->get();
276276

277-
return Arr::toArray($items);
277+
return Arr::resolve($items);
278278
}
279279

280280
protected function defaultSourceConnectionName(): string

tests/Unit/PostgresToPostgresTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public function testExcludeTablesOption()
144144
$this->assertDatabaseCount($this->table_baz, 3, $this->source_connection);
145145

146146
$this->artisan('db:migrate', [
147-
'--schema-from' => $this->source_connection,
148-
'--schema-to' => $this->target_connection,
149-
'--exclude' => [$this->table_foo, $this->table_bar],
147+
'--schema-from' => $this->source_connection,
148+
'--schema-to' => $this->target_connection,
149+
'--exclude' => [$this->table_foo, $this->table_bar],
150150
])
151151
->expectsConfirmation('Please confirm table list should be retrieved from target connection? (incase if source connection does not support it)', 'no')
152152
->expectsConfirmation('Please confirm whether to truncate target table before transfer?', 'no')
@@ -274,7 +274,7 @@ protected function tableData(string $connection, string $table): array
274274
{
275275
$items = DB::connection($connection)->table($table)->get();
276276

277-
return Arr::toArray($items);
277+
return Arr::resolve($items);
278278
}
279279

280280
protected function defaultSourceConnectionName(): string

0 commit comments

Comments
 (0)