Switch Events to a lower-case table name since postgresql is weird with casing
This commit is contained in:
parent
bc7cbdaa4e
commit
86ea344525
|
@ -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
|
||||
|
|
7
Makefile
7
Makefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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
|
||||
}, {});
|
||||
|
|
Loading…
Reference in New Issue