title: Forge Migrate CodeIgniter 4 Foreign Key Error
body: <p>When using or migrating Codeigniter to generate the relationship in the code below appears or error</p>
  
  <p>Migrate Product</p>
  
  <pre><code>public function up()
  {
  
      $this-&gt;forge-&gt;addField([
          'id'            =&gt; [
              'type'           =&gt; 'INT',
              'unsigned'       =&gt; TRUE,
              'auto_increment' =&gt; TRUE
          ],
          'categories_id' =&gt; [
              'type'          =&gt; 'INT'
          ],
          'product'       =&gt; [
              'type'          =&gt; 'VARCHAR',
              'constraint'    =&gt; '255'
          ]
      ]);
      $this-&gt;forge-&gt;addKey('id', TRUE);
      $this-&gt;forge-&gt;createTable('products');
      $this-&gt;forge-&gt;addForeignKey('categories_id', 'categories', 'id');
  
  }
  </code></pre>
  
  <p>Migrate Categories</p>
  
  <pre><code>$this-&gt;forge-&gt;addField([
          'id'            =&gt; [
              'type'           =&gt; 'INT',
              'unsigned'       =&gt; TRUE,
              'auto_increment' =&gt; TRUE
          ],
          'category'      =&gt; [
              'type'          =&gt; 'VARCHAR',
              'constraint'    =&gt; '255'
          ],
          'ordination'    =&gt; [
              'type'          =&gt; 'INTEGER'
          ],
          'isactive'      =&gt; [
              'type'          =&gt; 'INTEGER',
              'default'       =&gt; 1
          ]
      ]);
  
      $this-&gt;forge-&gt;addKey('id', TRUE);
      $this-&gt;forge-&gt;createTable('categories');
  </code></pre>
  
  <p>Error </p>
  
  <blockquote>
    <p>Type:        CodeIgniter\Database\Exceptions\DatabaseException
    Message:     Field <code>categories_id</code> not found.</p>
  </blockquote>