title: Sequelize not making a table
body: <p>So I'm making a discord bot and I've encountered an issue where if I restart (deploy) my bot, it won't make a table when I sync it. I did this last time and I think did it right but last time was a success while now it doesn't make a table. It returns nil so it doesn't save the data. And no it doesn't error.</p>
  <p>I'm also hosting the bot on heroku.</p>
  <p>data.js</p>
  <pre><code>const Sequelize = require(&quot;sequelize&quot;)
  
  const sequelize = new Sequelize('database', 'user', 'password', {
      host: 'localhost',
      dialect: 'sqlite',
      logging: false,
      storage: 'database.sqlite',
  })
  
  module.exports = class Data {
      constructor(name, attributes) {
          this.data = sequelize.define(name, attributes)
      }
  
      async create(values) {
          return await this.data.create(values)
      }
  
      async find(pk) {
          return await this.data.findByPk(pk)
      }
  
      async update(values, pk, pkv) {
          return await this.data.update(values, { where: { [pk]: pkv } })
      }
  
      async sync() {
          return this.data.sync()
      }
  }
  </code></pre>
  <p>start.js</p>
  <pre><code>const Data = require(&quot;./data&quot;)
  const Sequelize = require(&quot;sequelize&quot;)
  const client = new Client({ intents: [&quot;GUILDS&quot;, &quot;GUILD_MEMBERS&quot;, &quot;GUILD_MESSAGES&quot;] })
  
  const userData = new Data(&quot;User&quot;, {
      id: {
          type: Sequelize.INTEGER,
          unique: true,
          primaryKey: true
      },
      wallet: {
          type: Sequelize.BIGINT,
          defaultValue: 0
      },
      bank: {
          type: Sequelize.BIGINT,
          defaultValue: 100
      }
  })
  
  client.once(&quot;ready&quot;, async () =&gt; {
      await userData.sync()
  
      client.guilds.cache.forEach(async (guild) =&gt; {
          require(&quot;./registrator&quot;)(guild.id)
  
          await guild.members.fetch()
              .then((members) =&gt; {
                  members.forEach(async ({ id }) =&gt; {
                      const user = await userData.find(id)
  
                      if (!user) {
                          await userData.create({
                              id: id
                          })
                      }
                  })
              })
      })
  
      console.log(&quot;Ready&quot;)
  })
  
  </code></pre>
  <p>cash.js</p>
  <pre><code>async cmd(interaction, utils, userData)  {
                  const user = await userData.find(interaction.member.id)
                  const wallet = user.wallet
                  const bank = user.bank
                  const amount = interaction.options.getNumber(&quot;amount&quot;) || bank
  
                  if (amount &gt; 0) {
                      if (bank &gt;= amount) {
                          await userData.update({
                              wallet: wallet+amount,
                              bank: bank-amount
                          }, &quot;id&quot;, interaction.member.id)
                          
                          interaction.reply({ embeds: [
                              utils.embed(
                                  &quot;Withdrawn&quot;,
                                  interaction.member.displayAvatarURL(),
                                  `Successfully withdrawn ${amount} from your wallet from your bank!`
                              )
                          ] })
                      } else {
                          utils.error(&quot;You don't have enough money in the bank!&quot;)
                      }
                  } else {
                      utils.error(&quot;Amount must be greater than 0&quot;)
                  }
              }
  </code></pre>