Merged PetitTeton webapp with the inventory tracking app; Moved the database configuration out of git and added an example configuration; Added migrations to the mix so that we can easily update the production database and roll back changes to the database (from the command line install migrations [may not be necessary?]:

npm install -g sequelize-cli

To update the database after updating the app from git (on the command line in the webapp base directory):
sequelize db:migrate

To undo the last migrations:
sequelize db:migrate:undo
This commit is contained in:
Wynne Crisman
2016-06-13 11:54:12 -07:00
parent 6592feb97a
commit 0a7cff6672
29 changed files with 537 additions and 27 deletions

View File

@@ -20,9 +20,9 @@ var favicon = require('serve-favicon');
var nodeMailer = require('nodemailer');
//var configDB = require('./config/database.js');
var config = require('./config');
var models = require("./app/models");
var models = require("./models");
models.sequelize.sync().then(function () {
//models.sequelize.sync().then(function () {
//SMTP Transport setup.
var smtpTransport = nodeMailer.createTransport({host: config.smtpHost, port: config.smtpPort, secure: true, ignoreTLS: false, requiresAuth: true, auth: {user: config.smtpUser, pass: config.smtpPassword}});
@@ -82,8 +82,8 @@ models.sequelize.sync().then(function () {
console.log('The magic happens on port ' + port);
console.log("Root Path: " + rootPath);
console.log("Time now is: " + moment(new Date()).format("MMM Do YYYY, h:mm:ss a"));
}).error(function(err) {
console.log("Couldn't create or initialize the database:" + err);
})
//}).error(function(err) {
// console.log("Couldn't create or initialize the database:" + err);
//})