Skip to content

Commit

Permalink
package updates; add item-notes migration
Browse files Browse the repository at this point in the history
  • Loading branch information
maplethorpej committed Feb 13, 2021
1 parent 156e803 commit f62762b
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 167 deletions.
21 changes: 9 additions & 12 deletions api/migrations/20210103153722-add-item-notes.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('items', 'notes', {
type: Sequelize.STRING(500),
defaultValue: ''
}
})
},

down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('items', 'notes'),
}
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('items', 'notes', {
type: Sequelize.STRING(500),
defaultValue: ''
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('items', 'notes')
}
};
4 changes: 2 additions & 2 deletions api/models/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Sequelize from 'sequelize';
import { Sequelize } from 'sequelize';

const sequelize = new Sequelize(process.env.DATABASE_URL);
const sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres'});

const models = {
User: sequelize.import('./user'),
Expand Down
14 changes: 7 additions & 7 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"scripts": {
"dev": "nodemon -r esm index.js",
"start": "node -r esm index.js",
"migrate:dev": "npx sequelize-cli db:migrate",
"migrate:prod": "npx sequelize-cli --env production db:migrate",
"seed:dev": "npx sequelize-cli db:seed:all",
"seed:prod": "npx sequelize-cli --env production db:seed:all"
"migrate:dev": "sequelize db:migrate",
"migrate:prod": "sequelize --env production db:migrate",
"seed:dev": "sequelize db:seed:all",
"seed:prod": "sequelize --env production db:seed:all"
},
"dependencies": {
"@sentry/node": "5.7.1",
Expand All @@ -25,8 +25,8 @@
"mailchimp-api-v3": "^1.13.1",
"multer": "^1.4.2",
"node-mailjet": "^3.3.1",
"pg": "^7.11.0",
"sequelize": "^5.15.1",
"sequelize-cli": "^5.5.1"
"pg": "^8.5.1",
"sequelize": "^6.5.0",
"sequelize-cli": "^6.2.0"
}
}

0 comments on commit f62762b

Please sign in to comment.