jpotts18/mean-stack-relational

How to Migrate with an updated Models?

Closed this issue · 1 comments

I've try to install sequelize-cli and run sequelize db:migrate

Loaded configuration file "config/config.js".
Unable to connect to database: SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO)

When I run this: sequelize db:migrate NODE_ENV=development
it show this message
Loaded configuration file "config/config.js".

It will gives this error, if I don't migrate.

error:  Error: Failed to lookup view "error" in views directory "/Users/Roller/Working/Web/ponds_web/app/views"
        at EventEmitter.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/application.js:579:17)
        at ServerResponse.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/response.js:960:7)
        at ServerResponse.res.render (/Users/Roller/Working/Web/ponds_web/node_modules/view-helpers/index.js:65:13)
        at .<anonymous> (/Users/Roller/Working/Web/ponds_web/app/controllers/skintypes.js:107:20)
        at tryCatcher (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/util.js:16:23)
        at Promise._settlePromiseFromHandler (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/promise.js:504:31)

To migrate it, now I'm going to mysql console.

drop schema myschema;
create schema myschema;

then I run grunt, so everything is up to date.

This is just in the development only, I don't want database to be dropped everytime when I made change to the model.

#64 should fix this