Skip to content

Commit

Permalink
Reduce scope of changes.
Browse files Browse the repository at this point in the history
CI is too red right now.
  • Loading branch information
markstory committed Nov 1, 2024
1 parent 0fb6aba commit 1739d4c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 42 deletions.
2 changes: 0 additions & 2 deletions src/Command/BakeMigrationDiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;
use Cake\Console\ConsoleOptionParser;
use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Database\Schema\CollectionInterface;
use Cake\Database\Schema\TableSchema;
Expand Down Expand Up @@ -200,7 +199,6 @@ public function templateData(Arguments $arguments): array
'data' => $this->templateData,
'dumpSchema' => $this->dumpSchema,
'currentSchema' => $this->currentSchema,
'backend' => Configure::read('Migrations.backend', 'builtin'),
];
}

Expand Down
1 change: 0 additions & 1 deletion src/Command/BakeMigrationSnapshotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public function templateData(Arguments $arguments): array
'action' => 'create_table',
'name' => $this->_name,
'autoId' => $autoId,
'backend' => Configure::read('Migrations.backend', 'builtin'),
];
}

Expand Down
13 changes: 2 additions & 11 deletions src/Command/SnapshotTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;
use Cake\Core\Configure;

/**
* Trait needed for all "snapshot" type of bake operations.
Expand Down Expand Up @@ -63,11 +62,7 @@ protected function markSnapshotApplied(string $path, Arguments $args, ConsoleIo
$newArgs = array_merge($newArgs, $this->parseOptions($args));

$io->out('Marking the migration ' . $fileName . ' as migrated...');
if (Configure::read('Migrations.backend') == 'builtin') {
$this->executeCommand(MarkMigratedCommand::class, $newArgs, $io);
} else {
$this->executeCommand(MigrationsMarkMigratedCommand::class, $newArgs, $io);
}
$this->executeCommand(MigrationsMarkMigratedCommand::class, $newArgs, $io);
}

/**
Expand All @@ -83,11 +78,7 @@ protected function refreshDump(Arguments $args, ConsoleIo $io): void
$newArgs = $this->parseOptions($args);

$io->out('Creating a dump of the new database state...');
if (Configure::read('Migrations.backend') == 'builtin') {
$this->executeCommand(DumpCommand::class, $newArgs, $io);
} else {
$this->executeCommand(MigrationsDumpCommand::class, $newArgs, $io);
}
$this->executeCommand(MigrationsDumpCommand::class, $newArgs, $io);
}

/**
Expand Down
6 changes: 0 additions & 6 deletions templates/bake/config/diff.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@
<?php
declare(strict_types=1);
{% if backend == "builtin" %}
use Migrations\BaseMigration;
class {{ name }} extends BaseMigration
{% else %}
use Migrations\AbstractMigration;
class {{ name }} extends AbstractMigration
{% endif %}
{
{% if not autoId %}
public bool $autoId = false;
Expand Down
6 changes: 0 additions & 6 deletions templates/bake/config/snapshot.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@
<?php
declare(strict_types=1);
{% if backend == "builtin" %}
use Migrations\BaseMigration;
class {{ name }} extends BaseMigration
{% else %}
use Migrations\AbstractMigration;
class {{ name }} extends AbstractMigration
{% endif %}
{
{% if not autoId %}
public bool $autoId = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotAutoIdDisabledPgsql extends BaseMigration
class TestSnapshotAutoIdDisabledPgsql extends AbstractMigration
{
public bool $autoId = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotNotEmptyPgsql extends BaseMigration
class TestSnapshotNotEmptyPgsql extends AbstractMigration
{
/**
* Up Method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotPluginBlogPgsql extends BaseMigration
class TestSnapshotPluginBlogPgsql extends AbstractMigration
{
/**
* Up Method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotAutoIdDisabledSqlite extends BaseMigration
class TestSnapshotAutoIdDisabledSqlite extends AbstractMigration
{
public bool $autoId = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotNotEmptySqlite extends BaseMigration
class TestSnapshotNotEmptySqlite extends AbstractMigration
{
/**
* Up Method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;
use Migrations\AbstractMigration;

class TestSnapshotPluginBlogSqlite extends BaseMigration
class TestSnapshotPluginBlogSqlite extends AbstractMigration
{
/**
* Up Method.
Expand Down
4 changes: 2 additions & 2 deletions tests/comparisons/Seeds/pgsql/testWithData.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

use Migrations\AbstractSeed;
use Migrations\BaseSeed;

/**
* Events seed.
*/
class EventsSeed extends AbstractSeed
class EventsSeed extends BaseSeed
{
/**
* Run Method.
Expand Down
4 changes: 2 additions & 2 deletions tests/comparisons/Seeds/pgsql/testWithDataAndLimit.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

use Migrations\AbstractSeed;
use Migrations\BaseSeed;

/**
* Events seed.
*/
class EventsSeed extends AbstractSeed
class EventsSeed extends BaseSeed
{
/**
* Run Method.
Expand Down

0 comments on commit 1739d4c

Please sign in to comment.