不要怂,就是干,撸起袖子干!

Commit f63dc6b4 by Sascha Depold

Merge branch 'master' of https://github.com/sykopomp/sequelize into sykopomp-master

2 parents 8e975417 6691524e
Showing with 15 additions and 0 deletions
......@@ -101,6 +101,21 @@ if(program.migrate) {
if(['database', 'username', 'password'].indexOf(key) == -1) {
options[key] = value
}
if(key === "use_env_variable") {
if(process.env[value]) {
var db_info = process.env[value].match(
/([^:]+):\/\/([^:]+):([^@]+)@([^:]+):(\d+)\/(.+)/);
config.database = db_info[6];
config.username = db_info[2];
config.password = db_info[3];
options = _.extend(options, {
host: db_info[4],
port: db_info[5],
dialect: db_info[1],
protocol: db_info[1]
});
}
}
})
options = _.extend(options, { logging: false })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!