title: knex.js - migrate latest 'Already Up To Date'
body: <p>When I run knex migrate: latest, I get the following, "Already up to date".</p>
  
  <p>You see, I previously ran successful migrations, but then I used the mySQL CLI to delete those tables, because I was getting this 'Already up to date' message.  I thought deleting the tables would force knex to recognize it wasn't up to date.  Didn't work.  </p>
  
  <p>Any pointers?  </p>
  
  <p>Here are my files:</p>
  
  <p>knexfile.js:</p>
  
  <pre><code>require('dotenv').config();
  
  module.exports = {
  
    development: {
      client: 'mysql',
      connection: {
        host: process.env.DATABASE_HOST_DEV || '127.0.0.1',
        user: process.env.DATABASE_USER_DEV,
        password: process.env.DATABASE_PASSWORD_DEV,
        database: process.env.DATABASE_NAME_DEV
      },
      migrations: {
        directory: __dirname+'/database/migrations'
      }
    },
  
    staging: {
      client: 'mysql',
      connection: {
        host: '127.0.0.1',
        user: 'root',
        password: 'password',
        database: 'recipes'
      },
      pool: {
        min: 2,
        max: 10
      },
      migrations: {
        directory: __dirname+'/database/migrations'
      }
    },
  
    production: {
      client: 'mysql',
      connection: {
        host: process.env.DATABASE_HOST,
        user: process.env.DATABASE_USER,
        password: process.env.DATABASE_PASSWORD,
        database: process.env.DATABASE_NAME
      },
      pool: {
        min: 2,
        max: 10
      },
      migrations: {
        directory: __dirname+'/database/migrations'
      }
    }
  
  };
  </code></pre>
  
  <p>Migrations:</p>
  
  <pre><code>exports.up = function(knex, Promise) {
      return Promise.all([
          knex.schema.hasTable('recipe').then((exists) =&gt; {
              if (!exists) {
                  knex.schema.createTable('recipe', (table) =&gt; {
                      table.uuid('id');
                      table.string('name');
                      table.string('description');
                  })
              }
          }),
          knex.schema.hasTable('ingredient').then((exists) =&gt; {
              if (!exists) {
                  knex.schema.createTable('ingredient', (table) =&gt; {
                      table.uuid('id');
                      table.string('name');
                  })
              }
          }),
          knex.schema.hasTable('recipe-ingredient').then((exists) =&gt; {
              if (!exists) {
                  knex.schema.createTable('recipe-ingredient', (table)=&gt; {
                      table.foreign('recipe_id').references('recipe.id');
                      table.foreign('ingredient_id').references('ingredient.id');
                      table.string('qty');  // &lt;-- chose string instead of int because receipes include qty such as '1/3 cup', '1 teaspoon', etc.
                  })
              }
          })
      ])
  };
  
  exports.down = function(knex, Promise) {
      return Promise.all([
          knex.schema.dropTable('recipe-ingredient'),
          knex.schema.dropTable('ingredient'),
          knex.schema.dropTable('recipe')
      ])
  };
  </code></pre>