guiabolso / darwin Goto Github PK
View Code? Open in Web Editor NEWDatabase schema evolution library for Go
License: MIT License
Database schema evolution library for Go
License: MIT License
I really like this migration library (and I've tried several). My only complaint was getting started. I thought it might help others to share the approach I took.
I used a x.xx database versioning approach, but took the extra step to "minify" the script before including it in the migration. This allowed simple formatting and comment changes to be made (after release) without causing checksum errors.
Each migration step is a variable (with all steps of a major version defined inside a variable group for easy code folding).
I wanted to show the current database version with a before and after version if migrations were applied. Something like this:
DB Version: 2.01 (migrated from 1.03 to 2.01)
But I didn't want to perform an Info()
call twice just to get the last version each time (it returns all migrations from the database).
I also wanted to provide a detailed error message if a migration failed. I do this with the very convenient info channel feature.
Here is the what I ended up with:
https://gist.github.com/dougwinsby/48db699dadaee6f9d8e80ea692bb4c79
Hope it helps someone.
This is indeed a quite practical library. This would be nice for dependent software to have v1 released which would ensure a semver stable API.
Thanks a log
Hello, thanks for the tool, we chose it a few months ago for handling our migrations and it really eased the process of keeping our DBs up to date.
That being said, when an error occurs on running migrations, error messages don't enable us to find easily which migrations were being run. Do you think it could be improved ? I would not mind working on it if you cannot provide the worktime ;)
Cheers
Julien
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.