Switch Events to a lower-case table name since postgresql is weird with casing

This commit is contained in:
R. Tyler Croy 2018-09-10 09:36:39 -07:00
parent bc7cbdaa4e
commit 86ea344525
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
5 changed files with 10 additions and 9 deletions

View File

@ -1,8 +1,8 @@
const path = require('path')
module.exports = {
'config': path.resolve('config', 'database.js'),
'models-path': path.resolve('src', 'models')
'config' : path.resolve('config', 'database.js'),
'models-path' : path.resolve('src', 'models')
}
// vim: ft=javascript

View File

@ -23,12 +23,15 @@ clean:
debug-jest:
node --inspect-brk=0.0.0.0:9229 ./node_modules/.bin/jest
debug-db:
$(COMPOSE) run --rm db psql -h db -U postgres uplink_development
migrate: depends
$(COMPOSE) up -d db
@echo ">> waiting a bit to make sure the database comes online.."
@sleep 5
$(COMPOSE) run --rm -e NODE_ENV=development node \
/usr/local/bin/node node_modules/.bin/sequelize db:migrate
$(COMPOSE) run --rm node \
/usr/local/bin/node ./node_modules/.bin/sequelize db:migrate
watch:
jest --watchAll

View File

@ -7,8 +7,6 @@ services:
# Used for psql non-interactive scripting
- 'PGPASSWORD=jenkinsuplink'
- 'POSTGRES_DB=uplink_development'
ports:
- '5432:5432'
node:
image: node:10-alpine

View File

@ -1,7 +1,7 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('Events', {
return queryInterface.createTable('events', {
id: {
allowNull: false,
autoIncrement: true,
@ -29,6 +29,6 @@ module.exports = {
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Events');
return queryInterface.dropTable('events');
}
};

View File

@ -1,7 +1,7 @@
'use strict';
export default (sequelize, DataTypes) => {
const Event = sequelize.define('Event', {
const Event = sequelize.define('events', {
type: DataTypes.STRING,
payload: DataTypes.JSON
}, {});