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,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
})