diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31120742..b49f1ceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,15 @@ on: jobs: testsuite-linux: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - php-version: ['7.2', '8.0', '8.1'] + php-version: ['7.4', '8.0', '8.1'] db-type: [mysql, pgsql, sqlite] prefer-lowest: [''] include: - - php-version: '7.2' + - php-version: '7.4' db-type: 'sqlite' prefer-lowest: 'prefer-lowest' @@ -99,7 +99,7 @@ jobs: cs-stan: name: Coding Standard & Static Analysis - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -107,7 +107,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.2' + php-version: '7.4' extensions: mbstring, intl coverage: none tools: cs2pr diff --git a/composer.json b/composer.json index 219997f1..00627425 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "source": "https://github.com/cakephp/migrations" }, "require": { - "php": ">=7.2.0", + "php": ">=7.4.0", "robmorgan/phinx": "^0.12", "cakephp/orm": "^4.3.0", "cakephp/cache": "^4.3.0" diff --git a/src/View/Helper/MigrationHelper.php b/src/View/Helper/MigrationHelper.php index 7dff4d83..e5e9d8dc 100644 --- a/src/View/Helper/MigrationHelper.php +++ b/src/View/Helper/MigrationHelper.php @@ -382,7 +382,7 @@ public function getColumnOption(array $options) if (isset($columnOptions['signed']) && $columnOptions['signed'] === true) { unset($columnOptions['signed']); } - if (empty($columnOptions['precision'])) { + if ($columnOptions['precision'] === null) { unset($columnOptions['precision']); } else { // due to Phinx using different naming for the precision and scale to CakePHP diff --git a/tests/TestCase/MigrationsTest.php b/tests/TestCase/MigrationsTest.php index 947c3873..e71cd33e 100644 --- a/tests/TestCase/MigrationsTest.php +++ b/tests/TestCase/MigrationsTest.php @@ -225,7 +225,7 @@ public function testCreateWithEncoding() // Tests that if a collation is defined, it is used $numbersTable = $this->getTableLocator()->get('Numbers', ['connection' => $this->Connection]); $options = $numbersTable->getSchema()->getOptions(); - $this->assertSame('utf8_bin', $options['collation']); + $this->assertSame('utf8mb3_bin', $options['collation']); // Tests that if a collation is not defined, it will use the database default one $lettersTable = $this->getTableLocator()->get('Letters', ['connection' => $this->Connection]);