title: SequelizeDatabaseError: SQLITE_ERROR: no such table: Users
body: <p>I'm using Sequelize with sqlite and when i try to insert data to the table gives me the error</p>
  
  <pre><code>Executing (default): INSERT INTO `Users` (`id`,`username`,`password`,`createdAt`,`updatedAt`) 
  VALUES (NULL,$1,$2,$3,$4);
  { SequelizeDatabaseError: SQLITE_ERROR: no such table: Users
  </code></pre>
  
  <p>I'm using sequelize-cli to do migrations.</p>
  
  <p>This is my file structure img</p>
  
  <p><a href="https://i.stack.imgur.com/36p8I.png" rel="nofollow noreferrer">file structure</a></p>
  
  <p>globalConfigs.js </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const dotenv = require('dotenv');
  
  dotenv.config({
      path: './config.env'
  });
  
  module.exports = {
      port: process.env.PORT || 9000,
      database: {
          dialect: 'sqlite',
          sotrage: './MVC/db/dbFiles/portfolioDB.sqlite'
      }
  
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>dbConnectorConfig.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const globalConfigs = require('../globalConfigs/globalconfigs');
  const Sequelize = require('sequelize');
  
  
  const sequelize = new Sequelize(
      globalConfigs.database
  );
  
  module.exports = sequelize;</code></pre>
  </div>
  </div>
  </p>
  
  <p>userModel.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Sequelize = require("sequelize");
  const sequelize = require("../db/dbConnectorConfigs");
  
  module.exports = sequelize.define("User", {
      id: {
          type: Sequelize.INTEGER(11),
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
      },
      username: {
          type: Sequelize.STRING(35),
          allowNull: false,
          unique: true
      },
      password: {
          type: Sequelize.STRING(20),
          allowNull: false
      }
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>running : sequelize migration:create --name user_table</p>
  
  <p>I get the file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>'use strict';
  
  module.exports = {
    up: (queryInterface, Sequelize) =&gt; {
      return queryInterface.createTable('users', {
        id: {
          type: Sequelize.INTEGER(11),
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
        },
        username: {
          type: Sequelize.STRING(35),
          allowNull: false,
          unique: true
        },
        password: {
          type: Sequelize.STRING(20),
          allowNull: false
        },
        createdAt: Sequelize.DATE,
        updatedAt: Sequelize.DATE
  
      });
    },
  
    down: (queryInterface, Sequelize) =&gt; {
      return queryInterface.dropTable('users');
  
    }
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the config.json file generated by sequelize-cli </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "development": {
      "username": "root",
      "password": null,
      "host": "127.0.0.1",
      "dialect": "sqlite",
      "storage": "./db/dbFiles/portfolio.sqlite"
  
    },
    "test": {
      "username": "root",
      "password": null,
      "database": "database_test",
      "host": "127.0.0.1",
      "dialect": "mysql",
      "operatorsAliases": false
    },
    "production": {
      "username": "root",
      "password": null,
      "database": "database_production",
      "host": "127.0.0.1",
      "dialect": "mysql",
      "operatorsAliases": false
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>this is the file where user model create the user </p>
  
  <p>authenticationController.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const User = require("../models/userModel");
  
  exports.createUser = async (req, res, next) =&gt; {
    
    const user_created = await User.create({
         username: "userteste",
          password: "password"
          });
    
  };</code></pre>
  </div>
  </div>
  </p>