models initialization refactored, better dev experience as backend hmr is working

This commit is contained in:
lesion
2022-12-23 01:08:14 +01:00
parent 380eaa87ca
commit cbed0288fe
43 changed files with 624 additions and 707 deletions

View File

@@ -1,15 +1,9 @@
const sequelize = require('./index').sequelize
const { Model, DataTypes } = require('sequelize')
class EventNotification extends Model {}
EventNotification.init({
module.exports = (sequelize, DataTypes) =>
sequelize.define('event_notification', {
status: {
type: DataTypes.ENUM,
values: ['new', 'sent', 'error', 'sending'],
defaultValue: 'new',
index: true
}
}, { sequelize, modelName: 'event_notification' })
module.exports = EventNotification
})