Skip to content

Commit 4312ace

Browse files
authored
Merge pull request #8 from orisintel/chore/flip-bool-defaults-for-ease-of-use
chore(config/migration-snapshot): Change defaults of reordering and t…
2 parents 78b4296 + 19f79d3 commit 4312ace

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ path where Artisan will be run.
2222

2323
## Configuration
2424

25-
1. `php artisan vendor:publish --provider="\OrisIntel\MigrationSnapshot\ServiceProvider"`
26-
2. Consider reordering dumped rows if checking `schema.sql` into source control
27-
* Add `MIGRATION_SNAPSHOT_REORDER=1` to `.env`, or ...
28-
* Change default of `'reorder'` in `config/migration-snapshot.php` to `true`
25+
Put `migration-snapshot.php` into `config` with:
26+
``` bash
27+
php artisan vendor:publish --provider="\OrisIntel\MigrationSnapshot\ServiceProvider"
28+
```
2929

3030
## Usage
3131

config/migration-snapshot.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,25 @@
2323
| the migration records for consistency so the output file can be managed
2424
| in source control.
2525
|
26-
| If the order migrations are applied will produce significant differences,
27-
| such as changing the behavior of the app, then this should be left
28-
| disabled. In such cases `migrate:fresh --database=test` followed by
29-
| `migrate` or `migrate:dump` can achieve similar consistency.
26+
| If the order that closely versioned migrations are applied will produce
27+
| significant differences, such as changing the behavior of the app, then
28+
| disabling this may be preferred.
3029
|
3130
*/
3231

33-
'reorder' => env('MIGRATION_SNAPSHOT_REORDER', false),
32+
'reorder' => env('MIGRATION_SNAPSHOT_REORDER', true),
3433

3534
/*
3635
|--------------------------------------------------------------------------
37-
| Whether to trim underscores from foreign constraints for consistency.
36+
| Whether to trim leading underscores from foreign constraints.
3837
|--------------------------------------------------------------------------
3938
|
4039
| Percona's Online Schema Change for Mysql may prepend foreign constraints
4140
| with underscores. Since it may not be used in all environments some dumped
4241
| snapshots may not match, adding unnecessary noise to source control.
43-
| Enable this trimming to get more consistent snapshots when PTOSC may be
44-
| used.
42+
| Disable this trimming if leading underscores are significant for your use
43+
| case.
4544
|
4645
*/
47-
'trim-underscores' => env('MIGRATION_SNAPSHOT_TRIM_UNDERSCORES', false),
46+
'trim-underscores' => env('MIGRATION_SNAPSHOT_TRIM_UNDERSCORES', true),
4847
];

tests/Mysql/MigrateDumpTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88

99
class MigrateDumpTest extends TestCase
1010
{
11-
protected function getEnvironmentSetUp($app)
12-
{
13-
$app['config']->set('migration-snapshot.reorder', true);
14-
$app['config']->set('migration-snapshot.trim-underscores', true);
15-
}
16-
1711
public function test_handle()
1812
{
1913
$this->createTestTablesWithoutMigrate();

0 commit comments

Comments
 (0)