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')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
'config': path.resolve('config', 'database.js'),
|
'config' : path.resolve('config', 'database.js'),
|
||||||
'models-path': path.resolve('src', 'models')
|
'models-path' : path.resolve('src', 'models')
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: ft=javascript
|
// vim: ft=javascript
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -23,12 +23,15 @@ clean:
|
||||||
debug-jest:
|
debug-jest:
|
||||||
node --inspect-brk=0.0.0.0:9229 ./node_modules/.bin/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
|
migrate: depends
|
||||||
$(COMPOSE) up -d db
|
$(COMPOSE) up -d db
|
||||||
@echo ">> waiting a bit to make sure the database comes online.."
|
@echo ">> waiting a bit to make sure the database comes online.."
|
||||||
@sleep 5
|
@sleep 5
|
||||||
$(COMPOSE) run --rm -e NODE_ENV=development node \
|
$(COMPOSE) run --rm node \
|
||||||
/usr/local/bin/node node_modules/.bin/sequelize db:migrate
|
/usr/local/bin/node ./node_modules/.bin/sequelize db:migrate
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
jest --watchAll
|
jest --watchAll
|
||||||
|
|
|
@ -7,8 +7,6 @@ services:
|
||||||
# Used for psql non-interactive scripting
|
# Used for psql non-interactive scripting
|
||||||
- 'PGPASSWORD=jenkinsuplink'
|
- 'PGPASSWORD=jenkinsuplink'
|
||||||
- 'POSTGRES_DB=uplink_development'
|
- 'POSTGRES_DB=uplink_development'
|
||||||
ports:
|
|
||||||
- '5432:5432'
|
|
||||||
|
|
||||||
node:
|
node:
|
||||||
image: node:10-alpine
|
image: node:10-alpine
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
module.exports = {
|
module.exports = {
|
||||||
up: (queryInterface, Sequelize) => {
|
up: (queryInterface, Sequelize) => {
|
||||||
return queryInterface.createTable('Events', {
|
return queryInterface.createTable('events', {
|
||||||
id: {
|
id: {
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
|
@ -29,6 +29,6 @@ module.exports = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
down: (queryInterface, Sequelize) => {
|
down: (queryInterface, Sequelize) => {
|
||||||
return queryInterface.dropTable('Events');
|
return queryInterface.dropTable('events');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export default (sequelize, DataTypes) => {
|
export default (sequelize, DataTypes) => {
|
||||||
const Event = sequelize.define('Event', {
|
const Event = sequelize.define('events', {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
payload: DataTypes.JSON
|
payload: DataTypes.JSON
|
||||||
}, {});
|
}, {});
|
||||||
|
|
Loading…
Reference in New Issue