DiscordJS-Example/models/messages.js

24 lines
732 B
JavaScript
Raw Normal View History

2024-02-11 01:04:12 +00:00
import { DataTypes, Sequelize } from 'sequelize';
2024-02-06 15:18:06 +00:00
2024-02-11 01:04:12 +00:00
/**
* @typedef {Object} Message
* @property {string} id A Discord message ID.
2024-02-11 01:40:26 +00:00
* @property {(model: Object) => void} hasMany Defines an One-To-Many relationship.
* @property {(conditions: Object) => void} findOne Finds one instance in the database matching the provided condition(-s).
* @property {(conditions: Object) => void} findAll Finds all instances in the database matching the provided condition(-s).
2024-02-11 01:04:12 +00:00
*/
/**
* The definition of the `Message` table in the database.
* @param {Sequelize} sequelize
* @returns {Message}
*/
2024-02-06 15:18:06 +00:00
export default function (sequelize) {
return sequelize.define('Messages', {
id: {
type: DataTypes.STRING,
primaryKey: true
}
});
}