title: Why this foreign key is not working for delete action in knex?
body: <p>I have two tables, addresses and users, each user has an address, there is a column 'address_id' in table users that references a row in addresses table. But, when I delete a user, the address row is dont removed. Why?</p>
  <p>table_users:</p>
  <pre><code>exports.up = function(knex) {
      return knex.schema.createTable('users', function(table) {
          table.increments('id')
          table.text('name')
          table.text('cpf').unique()
          table.text('email').unique()
          table.text('pass')
          table.text('phone')
          table.timestamp('last_access').defaultTo(knex.fn.now())
          table.timestamp('created_at').defaultTo(knex.fn.now())
          table.timestamp('deleted_at').defaultTo(null)
          table.integer('address_id').unsigned()
          table.foreign('address_id').references('addresses.id').onDelete('CASCADE')
      })
  };
  
  exports.down = function(knex) {
      return knex.schema.dropTable('users')
  };
  
  </code></pre>
  <p>table_addresses:</p>
  <pre><code>exports.up = function(knex) {
      return knex.schema.createTable('addresses', function(table) {
          table.increments('id')
          table.text('street')
          table.text('number')
          table.text('complement')
          table.text('city')
          table.text('state')
          table.text('country')
          table.timestamp('last_access').defaultTo(knex.fn.now())
          table.timestamp('created_at').defaultTo(knex.fn.now())
          table.timestamp('deleted_at').defaultTo(null)
      })
  };
  
  exports.down = function(knex) {
      return knex.schema.dropTable('addresses')
  };
  
  </code></pre>
  <p>del function:</p>
  <pre><code>const del = (req, res, next) =&gt; { // TODO: colocar transaction aqui também
          knex('users').where({
              id: req.userData.id
          }).first().del().then(r =&gt; {
  
              if (!r) {
                  throw new CompleteError('Falha ao deletar usuário.', 400)
              }
  
              res.status(200).json({
                  sucess: true,
                  data: {
                      message: 'Usuário deletado com sucesso.'
                  }
              })
          }).catch(e =&gt; {
              return next(e)
          })
      }
  </code></pre>