DiscordJS-Example/models/guilds.js
2024-03-23 22:47:24 +01:00

25 lines
916 B
JavaScript

import { DataTypes, Sequelize } from 'sequelize';
/**
* @typedef {Object} Guild
* @property {string} id A Discord guild ID.
* @property {(model: Object) => void} hasMany Defines an One-To-Many relationship.
* @property {(conditions: Object) => Promise<Guild>} findOne Finds one instance in the database matching the provided condition(-s).
* @property {(conditions: Object) => Promise<Array<Guild>>} findAll Finds all instances in the database matching the provided condition(-s).
* @property {(conditions: Object) => Promise<Guild>} findOrCreate Finds or creates an instance in the database matching the provided condition(-s) or default values.
*/
/**
* The definition of the `Guild` table in the database.
* @param {Sequelize} sequelize
* @returns {Guild}
*/
export default function (sequelize) {
return sequelize.define('Guilds', {
id: {
type: DataTypes.STRING,
primaryKey: true
}
});
}