Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 21 18:38
    Travis db-migrate/cockroachdb (v4.2.3) passed (81)
  • Jan 21 18:37
    Travis db-migrate/cockroachdb (v4.2.2) passed (79)
  • Jan 21 18:30
    Travis db-migrate/cockroachdb (v4.2.1) passed (77)
  • Jan 16 22:53
    olso commented #548
  • Jan 12 11:32
    Travis db-migrate/node-db-migrate@d11d65a (dependabot/npm_and_yarn/lodash-4.17.15) passed (1015)
  • Jan 12 11:30
    Travis db-migrate/node-db-migrate@d11d65a (dependabot/npm_and_yarn/lodash-4.17.15) passed (1015)
  • Jan 12 11:29
    dependabot[bot] labeled #662
  • Jan 12 11:29
    dependabot[bot] opened #662
  • Jan 12 11:29

    dependabot[bot] on npm_and_yarn

    chore(deps): bump lodash from 4… (compare)

  • Jan 12 11:28

    wzrdtales on master

    Fix: Ensure scoped migration cr… fix(test): added create scoped … Merge pull request #655 from An… (compare)

  • Jan 12 11:28
    wzrdtales closed #655
  • Jan 12 11:28
    wzrdtales commented #655
  • Jan 12 11:25
    stale[bot] unlabeled #655
  • Jan 12 11:25
    wzrdtales labeled #655
  • Jan 12 06:29
    stale[bot] labeled #655
  • Jan 12 06:29
    stale[bot] commented #655
  • Jan 09 23:47
    dandrewgarvin edited #661
  • Jan 09 23:41
    dandrewgarvin opened #661
  • Jan 06 20:56
    Travis db-migrate/cockroachdb (v4.2.0) passed (75)
  • Dec 27 2019 09:49
    tjokimie commented #578
Tobias Gurtzick
if you don't care about that and your application is not that critical you can go for comfortable, but less safe and with less control, solutions like sequelize and others
just weigh your options and decide
Scott Stern
Hello, I am trying to use the programmable API for getInstance and I am passing in options as an object but getting errors TypeError: Cannot read property 'charCodeAt' of undefined. Any ideas? Thank you
Daniel Bretoi
hi i'm getting TypeError: Promise.fromCallback is not a function from node_modules/db-migrate/api.js:195 anyone know what's up with that? Seems this fromCallback is no longer part of bluebird
ok, nm, i guess it's an older one it wasn't part of
and the older one got required first in the chain
Hi! i was wondering how to create a migration script, with default value using the literal DEFAULT_TIMESTAMP of mysql. i tried to search the docs & repo for ways to do this, but can't find any. can anyone help me please? Thanks!
Tobias Gurtzick
@shierro depends on the driver. in doubt new String('xyz') always works
in updated drivers such as the cockroachdb one there is a new raw property
in those you can write it like this:
    createdAt: {
      type: 'timestamptz',
      notNull: true,
      defaultValue: {
        raw: 'CURRENT_TIMESTAMP()'
if i am right this needs to be added to the other official drivers though. in that case fall back to new String
and you mean probably CURRENT_TIMESTAMP and not DEFAULT_TIMESTAMP
this is natively supported by the mysql driver anyway
just put it like that defaultValue: 'CURRENT_TIMESTAMP'
new String and raw will be more cross compatible in doubt though
ah yes, i was looking for the raw option, and yes for CURRENT_TIMESTAMP thanks @wzrdtales you're awesome
this is useful. although i haven't been able to see it in the docs. might be good if we can add it there for future reference
Tobias Gurtzick
np, it is not yet in the docs, and not yet in all drivers
I intend to add a special property as well
where I can put well known functions like current_timestamp across the board
and keep raw for the unique stuff
Hi. I'm getting an error [ERROR] Error: Environment(s) 'all' not found. My database.json file just contains one line: {
"all": {"ENV":"DATABASE_URL"}
}. Can you assist?
This is only happening within a Heroku release, not locally
and using command: db-migrate up --config config/database.json -e all
Tobias Gurtzick
you're using that wrong
first of all never name your target config all
all is a reserved key in a lot of cases
second of all, when you want to use DATABASE_URL you do not need any db config at all normally
and the error happens b/c the environment variable is not set
you need to check on your side why
Dmitry Dzhus
Hey all, I can't find anything on the status of COPY support – is it expected to work if I want to manage some custom data in migrations too? currently getting this on 0.11.5:
received data: CREATE TABLE test_data (col1 text, col2 text);

COPY test_data (col1, col2) FROM stdin;
a       b
c       d

[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: syntax error at or near "a"

guys stupid question about installation
i am confused...
npm install -g db-migrate - done
creating the migration: db-migrate create initial

and the result is like this

'use strict';

var dbm;
var type;
var seed;

  * We receive the dbmigrate dependency from dbmigrate initially.
  * This enables us to not have to rely on NODE_PATH.
exports.setup = function(options, seedLink) {
  dbm = options.dbmigrate;
  type = dbm.dataType;
  seed = seedLink;

exports.up = function(db) {
  return null;

exports.down = function(db) {
  return null;

exports._meta = {
  "version": 1

this is definitely not the same as in docs
and i think its from another package at all
or... docs are a little bit wrong?

hello all! I am new to using db-migrate. I am needing some help with a small ..error? I'm getting a reply that require db-migrate-mongodb and ./mongodb are needed I believe. I can supply the full return if needed. This is all coming from the verbose print btw
@taburetkin I believe the docs are at least a few minor releases behind. That is my suspicion anyways.
Eduardo Tamaki
Hi, Is there a way to generate a migration file for the current database?
Hey There, does any of you know how to set a default decimal place for decimal data type inside of the exports.up variable?
I have done like "column_name { type: 'decimal', length: '10,2'}" and "column_name {type:'decimal', precision: 10, scale: 2}"
But none of these works...
hi guys
can you point me to examples of this framework please?