Skip to content

Commit

Permalink
Merge pull request #562 from CakeDC/issue/500-decimal-no-precision
Browse files Browse the repository at this point in the history
Fixes #500 . If precision is 0 command adds it anyway.
  • Loading branch information
markstory authored Sep 25, 2022
2 parents 1019fd4 + 2c2cd1f commit 8ba15cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -99,15 +99,15 @@ jobs:

cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
php-version: '7.4'
extensions: mbstring, intl
coverage: none
tools: cs2pr
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/MigrationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/MigrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 8ba15cc

Please sign in to comment.