Comments (7)
from sql-migrate.
It seems a bit strange that the migrations can be accessed via bindata, but then a config file is still required?
from sql-migrate.
@paulwalker please open a different issue when asking a different question.
from sql-migrate.
I was able to use environment variables within the dbconfig.yml file:
development:
dialect: mysql
datasource: ${DBUSER}:${DBPASS}@tcp(${DBHOST}:${DBPORT})/${DBNAME}?parseTime=true
dir: migrations
table: migrations
from sql-migrate.
Add docs to readme for this in #143
@rubenv @sbrudz
from sql-migrate.
@sbrudz @risentveber That is not the same as using env vars directly. See the Factor III. in Twelve Factor App.
Quoting:
Another approach to config is the use of config files which are not checked into revision control, such as config/database.yml in Rails. This is a huge improvement over using constants which are checked into the code repo, but still has weaknesses: it’s easy to mistakenly check in a config file to the repo; there is a tendency for config files to be scattered about in different places and different formats, making it hard to see and manage all the config in one place. Further, these formats tend to be language- or framework-specific.
Emphasis mine.
Personally environment variables are better because it's much easier to set with tools like the shell scripts, docker env vars, kubernetes manifest, heroku settings page etc. Requiring there to be a file on disk creates a dependency on the file system, meaning for each place we deploy (container image, prod servers, staging servers etc.) we need to add code to place this file at the right place and at the right time before things will actually work.
This also prevent deploying a standalone fat Go binary with everything inside it. Which is one of the main advantages of using Go in the first place.
from sql-migrate.
@rubenv ah ok, thanks for clarifying. so the primary use case is actually to embed and roll our own cmds.
from sql-migrate.
Related Issues (20)
- Error: unterminated dollar-quoted string at or near "$$ DECLARE row record"
- Request: Update go-sqlite3 dependency to latest (1.14.14) HOT 3
- Migration not applied
- IgnoreUnknown is not working
- SetTable fails race detector HOT 3
- Support for multiple migration dirs
- Where may I ask questions? HOT 2
- gorp retracted by module author warning HOT 2
- Support for exclusive connection while executing migration HOT 3
- ToApply doesn't consider IgnoreUnknown flags when apply migrations up dir HOT 1
- Multiple `migrate Up` blocks in a single file? HOT 1
- Migrate transactions for multiple shards HOT 5
- [Proposal] Addition of 'reset' to sql-migrate command HOT 3
- Go install fails on Go 1.19 HOT 5
- schema field in dbconfig.yml being ignored
- Doing a migrate down when there is a migration “hole” is corrupting the database
- MemoryMigrationSource execution order is wrong HOT 2
- [BUG] Missing integrity checks on migrations lead to corrupt DB schema state HOT 3
- Logic Bug with ExecVersion HOT 1
- Possible release to fix build issue on Alpine Linux HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql-migrate.