mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-29 06:28:59 +11:00
34 lines
811 B
JavaScript
34 lines
811 B
JavaScript
|
"use strict"
|
||
|
const { Model } = require("sequelize")
|
||
|
module.exports = (sequelize, DataTypes) => {
|
||
|
class Feedback extends Model {
|
||
|
/**
|
||
|
* Helper method for defining associations.
|
||
|
* This method is not a part of Sequelize lifecycle.
|
||
|
* The `models/index` file will call this method automatically.
|
||
|
*/
|
||
|
// eslint-disable-next-line no-unused-vars
|
||
|
static associate(models) {
|
||
|
Feedback.belongsTo(models.User, {
|
||
|
foreignKey: "userId",
|
||
|
as: "user"
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
Feedback.init(
|
||
|
{
|
||
|
feedbackText: DataTypes.TEXT,
|
||
|
starRating: DataTypes.BIGINT,
|
||
|
route: DataTypes.STRING,
|
||
|
userId: DataTypes.STRING,
|
||
|
tenant: DataTypes.STRING,
|
||
|
debug: DataTypes.JSON
|
||
|
},
|
||
|
{
|
||
|
sequelize,
|
||
|
modelName: "Feedback"
|
||
|
}
|
||
|
)
|
||
|
return Feedback
|
||
|
}
|