Hi guys can you help me with my problem, somebody experienced db-migrate up for posgre
here that nothing happens after using use command db-migrate up
$ db-migrate up add-terminal-business-addr
Database config:
{
"dev": {
"driver": "pg",
"user": "postgres",
"password": "",
"host": "localhost",
"port": "5432",
"database": "postgres"
}
}
'use strict'
var dbm;
var type;
var seed;
/**
* We receive the dbmigrate dependency from the dbmigrate initially.
* This enable us to not have to rely on NODE_PATH.
*/
export.setup = function(options, seedLink) {
dbm = options.dbmigrate;
type = options.dataType;
seed = seedLink;
};
export.up = function(db) {
return db.removeColumn('terminals', 'business_address');
};
export.down = function(db) {
return db.addColumn('terminals', 'business_address', {type: 'jsonb', notNull: false});
};
export._meta = {
"version": 1;
};
Well the problem might be :
In production or having important data in development you should take time to investigate the issue. In this case you most likely had created an empty migration, ran rake db:migrate, then added instructions to the migration, so you don't see a new field and further rake db:migrate does nothing. To resolve this issue you need to comment your change instructions, perform rake db:rollback, uncomment instructions and then rake db:migrate to apply instructions you missed.
Try to rebuild your database structure(WARNING: all db-data will be lost):
If you use Rails < 4.1, don't forget to prepare test database:
This is the easiest solution since you are working with tutorial.