Skip to content
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

Support postgrator v5, add cosmiconfig, etc #30

Merged
merged 35 commits into from
Feb 17, 2022
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f3dd416
Migrate to cosmiconfig
perrin4869 Nov 18, 2021
4a369ce
Test --no-config option
perrin4869 Nov 19, 2021
f5d5cd4
Update README.md
perrin4869 Nov 19, 2021
1ef8b01
Upgrade eslint and eslint-config-airbnb
perrin4869 Nov 21, 2021
16df32a
Remove redundant postgrator.json
perrin4869 Nov 21, 2021
bb8e7f4
Make type module
perrin4869 Nov 21, 2021
b922d23
Update command-line dependencies
perrin4869 Nov 21, 2021
91b2118
Small improvements
perrin4869 Nov 21, 2021
fefe433
Add docker-compose.yml
perrin4869 Nov 21, 2021
c6a8dde
Upgrade to postgrator 5
perrin4869 Nov 22, 2021
41234fb
Add mysql and mssql support
perrin4869 Nov 22, 2021
9c5de99
Attempt fix
perrin4869 Nov 22, 2021
9afd1a1
secure option -> ssl
perrin4869 Nov 24, 2021
49e127f
v5 requires node >= 12
perrin4869 Nov 24, 2021
52792f6
mssql encrypt is false by default
perrin4869 Nov 24, 2021
ee857ae
Fix published files
perrin4869 Nov 24, 2021
a9ec341
Add config option
perrin4869 Nov 27, 2021
2372088
Replace assert with chai
perrin4869 Nov 28, 2021
d3bd30a
Support merging options
perrin4869 Nov 29, 2021
e7d7630
Fix node 12
perrin4869 Nov 29, 2021
d0a3ee6
Remove restoreOptions from tests
perrin4869 Nov 29, 2021
760ecfc
Merge pull request #3 from perrin4869/feature/config-flag-merge-options
perrin4869 Nov 29, 2021
f0c77a9
Remove default values from host, user, database
perrin4869 Nov 29, 2021
c54ff63
Add missing tests
perrin4869 Nov 29, 2021
eb1225b
Update README and CHANGELOG
perrin4869 Nov 29, 2021
7fbca07
Add coverage reports
perrin4869 Nov 29, 2021
2ef5014
Fix README example
perrin4869 Nov 29, 2021
210692b
Add multi command support and drop-schema command
perrin4869 Nov 30, 2021
ac0eaba
Merge pull request #4 from perrin4869/feature/remove-schema
perrin4869 Nov 30, 2021
fcf5b70
Isolate commands
perrin4869 Nov 30, 2021
f1a0c18
Merge pull request #5 from perrin4869/chore/isolate-commands
perrin4869 Nov 30, 2021
da10f49
Minor refactoring
perrin4869 Nov 30, 2021
7165bd4
Fix running postgrator 0
perrin4869 Nov 30, 2021
a69bde1
Fix case where _unknown is undefined
perrin4869 Nov 30, 2021
d389307
Test rejecting invalid commands
perrin4869 Dec 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove restoreOptions from tests
perrin4869 committed Nov 29, 2021
commit d0a3ee6f93ea1138d96616436c6b9ea27f926a2d
9 changes: 2 additions & 7 deletions test/postgrator-cli-tests.js
Original file line number Diff line number Diff line change
@@ -62,8 +62,6 @@ function getDefaultOptions() {
postgres, mysql, sql server, etc.
============================================================================= */
function buildTestsForOptions(options) {
const restoreOptions = () => {};

function getArgList(opts) {
return Object.entries(opts)
.map(([key, val]) => [`--${key}`].concat(typeof val === 'boolean' ? [] : [val]))
@@ -164,7 +162,6 @@ function buildTestsForOptions(options) {
action: 'undo',
},
});
restoreOptions();
});
});

@@ -210,7 +207,6 @@ function buildTestsForOptions(options) {

return mockCwd(path.join(__dirname, 'sample-config'), async () => {
await expect(run()).to.eventually.have.lengthOf(0);
restoreOptions();
});
});

@@ -328,17 +324,16 @@ function buildTestsForOptions(options) {
});
});

tests.push(async () => {
tests.push(() => {
console.log('\n----- testing detecting migration files with same number-----');
const args = getArgList({
...options,
to: 3,
'migration-pattern': 'test/conflicting-migrations/*',
});

await expect(run(args))
return expect(run(args))
.to.be.rejectedWith(Error, /^Two migrations found with version 2 and action do/, 'No migration conflicts were detected');
restoreOptions();
});

tests.push(() => removeVersionTable({