-
Notifications
You must be signed in to change notification settings - Fork 121
Fix up decimal migration_diff #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
17c402f
Fix up decimal migration_diff
dereuromark 4555456
Add .gitkeep for MigrationsDiffDecimalChange directory
dereuromark 0dc4fad
Update tests/TestCase/Command/BakeMigrationDiffCommandTest.php
dereuromark 22061a3
Update tests/TestCase/Command/BakeMigrationDiffCommandTest.php
dereuromark ae99ccd
Merge branch '5.x' into 5.x-decimal-diff
dereuromark 9c943ff
Fixes.
dereuromark 59e9a69
Fixes.
dereuromark a2e5241
Fixes.
dereuromark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/comparisons/Diff/decimalChange/initial_decimal_change_mysql.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| use Migrations\BaseMigration; | ||
|
|
||
| class InitialDecimalChangeMysql extends BaseMigration | ||
| { | ||
| /** | ||
| * Up Method. | ||
| * | ||
| * More information on this method is available here: | ||
| * https://book.cakephp.org/migrations/5/en/migrations.html#the-up-method | ||
| * | ||
| * @return void | ||
| */ | ||
| public function up(): void | ||
| { | ||
| $this->table('test_decimal_types') | ||
| ->addColumn('amount', 'decimal', [ | ||
| 'default' => null, | ||
| 'null' => false, | ||
| 'precision' => 5, | ||
| 'scale' => 2, | ||
| ]) | ||
| ->create(); | ||
| } | ||
|
|
||
| /** | ||
| * Down Method. | ||
| * | ||
| * More information on this method is available here: | ||
| * https://book.cakephp.org/migrations/5/en/migrations.html#the-down-method | ||
| * | ||
| * @return void | ||
| */ | ||
| public function down(): void | ||
| { | ||
| $this->table('test_decimal_types')->drop()->save(); | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
tests/comparisons/Diff/decimalChange/mysql/the_diff_decimal_change_mysql.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| use Migrations\BaseMigration; | ||
|
|
||
| class TheDiffDecimalChangeMysql extends BaseMigration | ||
| { | ||
| /** | ||
| * Up Method. | ||
| * | ||
| * More information on this method is available here: | ||
| * https://book.cakephp.org/migrations/5/en/migrations.html#the-up-method | ||
| * | ||
| * @return void | ||
| */ | ||
| public function up(): void | ||
| { | ||
|
|
||
| $this->table('test_decimal_types') | ||
| ->changeColumn('id', 'integer', [ | ||
| 'default' => null, | ||
| 'length' => null, | ||
| 'limit' => null, | ||
| 'null' => false, | ||
| 'signed' => false, | ||
| ]) | ||
| ->changeColumn('amount', 'decimal', [ | ||
| 'default' => null, | ||
| 'null' => false, | ||
| 'precision' => 5, | ||
| 'scale' => 2, | ||
| ]) | ||
| ->update(); | ||
| } | ||
|
|
||
| /** | ||
| * Down Method. | ||
| * | ||
| * More information on this method is available here: | ||
| * https://book.cakephp.org/migrations/5/en/migrations.html#the-down-method | ||
| * | ||
| * @return void | ||
| */ | ||
| public function down(): void | ||
| { | ||
|
|
||
| $this->table('test_decimal_types') | ||
| ->changeColumn('id', 'integer', [ | ||
| 'autoIncrement' => true, | ||
| 'default' => null, | ||
| 'length' => 11, | ||
| 'null' => false, | ||
| ]) | ||
| ->changeColumn('amount', 'decimal', [ | ||
| 'default' => null, | ||
| 'null' => false, | ||
| 'precision' => 10, | ||
| 'scale' => 2, | ||
| ]) | ||
| ->update(); | ||
| } | ||
| } |
Binary file added
BIN
+1.22 KB
tests/comparisons/Diff/decimalChange/schema-dump-test_comparisons_mysql.lock
Binary file not shown.
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.