Skip to content

Commit

Permalink
Merge pull request #15 from byjg/4.0
Browse files Browse the repository at this point in the history
4.0
  • Loading branch information
byjg authored Nov 24, 2018
2 parents 0b78c0f + 1a6bb80 commit 8b4b1a2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Because of that this is an agnostic project (independent of framework and Progra
## Installing

```
composer require 'byjg/migration=2.0.*'
composer require 'byjg/migration=4.0.*'
```

## Supported databases:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"byjg/anydataset": "^3.0",
"byjg/anydataset-db": "4.0.*",
"byjg/uri": "^1.0",
"symfony/console": "^3.1"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Database/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace ByJG\DbMigration\Database;

use ByJG\AnyDataset\DbDriverInterface;
use ByJG\AnyDataset\Factory;
use ByJG\AnyDataset\Db\DbDriverInterface;
use ByJG\AnyDataset\Db\Factory;
use ByJG\DbMigration\Exception\DatabaseNotVersionedException;
use ByJG\DbMigration\Exception\OldVersionSchemaException;
use Psr\Http\Message\UriInterface;
Expand All @@ -16,7 +16,7 @@ abstract class AbstractDatabase implements DatabaseInterface
private $dbDriver;

/**
* @var \Psr\Http\Message\UriInterface
* @var UriInterface
*/
private $uri;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Database/DblibDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ByJG\DbMigration\Database;

use ByJG\AnyDataset\Factory;
use ByJG\AnyDataset\Db\Factory;
use ByJG\Util\Uri;
use Psr\Http\Message\UriInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Database/MySqlDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ByJG\DbMigration\Database;

use ByJG\AnyDataset\Factory;
use ByJG\AnyDataset\Db\Factory;
use ByJG\Util\Uri;
use Psr\Http\Message\UriInterface;

Expand Down
4 changes: 2 additions & 2 deletions src/Database/PgsqlDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ByJG\DbMigration\Database;

use ByJG\AnyDataset\Factory;
use ByJG\AnyDataset\Db\Factory;
use ByJG\Util\Uri;
use Psr\Http\Message\UriInterface;

Expand All @@ -23,7 +23,7 @@ protected static function getDbDriverWithoutDatabase(UriInterface $uri)
}

/**
* @param \ByJG\AnyDataset\DbDriverInterface $dbDriver
* @param \ByJG\AnyDataset\Db\DbDriverInterface $dbDriver
* @param $database
*/
protected static function createDatabaseIfNotExists($dbDriver, $database)
Expand Down
8 changes: 2 additions & 6 deletions src/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ByJG\DbMigration;

use ByJG\AnyDataset\DbDriverInterface;
use ByJG\AnyDataset\Db\DbDriverInterface;
use ByJG\DbMigration\Database\DatabaseInterface;
use ByJG\DbMigration\Exception\DatabaseDoesNotRegistered;
use ByJG\DbMigration\Exception\DatabaseIsIncompleteException;
Expand Down Expand Up @@ -241,11 +241,7 @@ protected function canContinue($currentVersion, $upVersion, $increment)
$compareVersion =
intval($currentVersion) < intval($upVersion)
? -1
: (
intval($currentVersion) > intval($upVersion)
? 1
: 0
);
: (intval($currentVersion) > intval($upVersion) ? 1 : 0);

return !($existsUpVersion && ($compareVersion === intval($increment)));
}
Expand Down

0 comments on commit 8b4b1a2

Please sign in to comment.