models initialization refactored, better dev experience as backend hmr is working
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
|
||||
const sequelize = require('./index').sequelize
|
||||
const { Model, DataTypes } = require('sequelize')
|
||||
|
||||
class Notification extends Model {}
|
||||
|
||||
Notification.init({
|
||||
module.exports = (sequelize, DataTypes) =>
|
||||
sequelize.define('notification', {
|
||||
filters: DataTypes.JSON,
|
||||
email: DataTypes.STRING,
|
||||
remove_code: DataTypes.STRING,
|
||||
@@ -24,6 +19,4 @@ Notification.init({
|
||||
unique: true,
|
||||
fields: ['action', 'type']
|
||||
}]
|
||||
})
|
||||
|
||||
module.exports = Notification
|
||||
})
|
||||
Reference in New Issue
Block a user