Skip to content
Advertisement

Sequelize table is not created, even though I used Sequelize.define()

Repository (code): https://github.com/JavascriptLearner815/spelta-discord-bot/tree/development

I am creating a Discord bot with Discord.js. I wanted to add three DM commands for the bot: dm, reply, and followup.

In order to reply to the last DM, I needed to use SQLITE. I made and required a database.js file to do that, using the discord.js guide for SQLite. But when I run the command dm, the table isn’t even created!

My code editor does in fact show the files database.js and database.sqlite.

I have also tried using node database.js.

In Discord, I get the messages from my alt and my main account, but it replies to my interaction with “Error! Either you or the recipient have disabled DMs!” This is actually my message that gets sent with a catch.

What could be the problem here?

P.S. If you prefer viewing the code right here on StackOverflow, here it is:

commands/dm.js:

JavaScript

database.js:

JavaScript

Error: SQLITE_ERROR: no such table: dms

Advertisement

Answer

JavaScript

you should check Sequelize Synchronizing all model

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement