// See http://docs.sequelizejs.com/en/latest/docs/models-definition/ // for more of what you can do here. import { Sequelize, DataTypes } from 'sequelize'; import { Application } from 'mikudos-node-app'; export default function(app: Application) { const sequelizeClient: Sequelize = app.get('sequelizeClient'); const methods = sequelizeClient.define( 'methods', { file: { type: DataTypes.STRING, allowNull: false }, package: { type: DataTypes.STRING, allowNull: false }, service: { type: DataTypes.STRING, allowNull: false }, path: { type: DataTypes.STRING, allowNull: false, unique: true }, method: { type: DataTypes.STRING, allowNull: false }, type: { type: DataTypes.STRING } }, { hooks: { beforeCount(options: any) { options.raw = true; } } } ); // eslint-disable-next-line no-unused-vars (methods as any).associate = function(models: any) { // Define associations here // See http://docs.sequelizejs.com/en/latest/docs/associations/ }; methods.sync(); return methods; }