Skip to content

[wip] Add MongoDB support#2

Closed
gravis wants to merge 84 commits intolepoetemaudit:masterfrom
gemnasium:mongodb
Closed

[wip] Add MongoDB support#2
gravis wants to merge 84 commits intolepoetemaudit:masterfrom
gemnasium:mongodb

Conversation

@gravis
Copy link
Copy Markdown

@gravis gravis commented Aug 15, 2016

taken from mattes#118

fazal and others added 30 commits June 17, 2015 13:07
Get default URL from environment variable MIGRATE_URL
Added a unit test to demonstrate the problem in issue #45

The introduced makeFiles() function could be used to simplify the other
tests too, but I didn't touch more than necessary for this commit.
This is the bare minimum proposed fix for #45

By using a nested map the way I do in this PR we could also simplify the
logic further down where we look for matching direction.Up or
direction.Down migrations.
This project depends on github.com/gocql/gocql, which does not support
go 1.2.

Update the .travis.yml file to match that reality.

Add go 1.4 and 1.5 to the test matrix.
Proposed fix for migration file name clashes
[skipci]
We can't test driver.New methods because of circular imports.
That's probably why the initial code had a map[string]interface{} as
registry: it removes a dependency import.
I prefer the remove the registry and have a registry returning a real
Driver. It will ease the development later.
This change insert a timestamped version into schema migration table,
instead of incrementing a field. That way, we have a history of passed
migrations.
Next step: Apply all pending migrations.
Pending migrations being the list of all migrations from files, except
the ones already applied (d.Versions())
jmhodges and others added 28 commits May 1, 2016 09:12
With this patch, folks who were using the mattes/migrate version of this tool
can switch to this without having to do extra work.

They have 32-bit bit versions in their PostgreSQL and MySQL database
that this tool can upgrade to 64-bit on its first check that the
migration version table exists. Only those two databases seem to need
their schema updated.
use a non-zero exit code when no command is given
correct other import paths in CI and tests
…ards

make timestamp versioning backwards compatible
- Added go methods migrator, mongo db template: different from the usual driver
model.
- Added support for bidirectional files (for go methods), appending _up or _down upon context
- Added DriverWithFilnameParser for providing custom filename parser functionality that knows to parse bi-directional file names.
- Changed logic not to use custom filename parser:
  -Supporting up and down files only, no both direction files
  -Using method names as is
- Added complete test to the mongo db migration scenarios
…cific methods

- defined methods receivers registration by name and change the migration files format to include them
- added extensive testing
- currently each driver contains only a single method receiver:
   - enforcing method receiver pre-registration on go methods driver initialization
   - Method receiver name can be removed from files format
- passing the DbName parameter inside the method receiver for the go methods driver
closes #116
@gravis
Copy link
Copy Markdown
Author

gravis commented Aug 15, 2016

wrong repo, sorry

@gravis gravis closed this Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.