CodeIgniter Forums
dropTable() not working when no database prefix set. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: dropTable() not working when no database prefix set. (/showthread.php?tid=68995)



dropTable() not working when no database prefix set. - jaynarayan - 09-25-2017

Hi, 
When I roll out migration ,the following error appears:

D:\xampp\htdocs\ci4.dev\pms>php spark migrate:rollback

CodeIgniter CLI Tool - Version 4.0-dev - Server-Time: 2017-09-25 20:22:32pm

Rolling back all migrations...

strpos(): Empty needle
D:\xampp\htdocs\ci4.dev\pms\system\Database\Forge.php - 492

Done

my migration code is

PHP Code:
<?php namespace App\Database\Migrations;

use 
CodeIgniter\Database\Migration;

class 
Migration_Add_project_table extends Migration
{
    

    public function 
up()
    {
        
        
$this->forge->addField([
            
'blog_id'          => [
                
'type'           => 'INT',
                
'constraint'     => 5,
                
'unsigned'       => true,
                
'auto_increment' => true,
            ],
            
'blog_title'       => [
                
'type'       => 'VARCHAR',
                
'constraint' => '100',
            ],
            
'blog_description' => [
                
'type' => 'TEXT',
                
'null' => true,
            ],
        ]);
                
$this->forge->addKey('blog_id'true);
                
$this->forge->createTable('blog');
    }
    public function 
down()
    {
         
$this->forge->dropTable('blog');
    }




RE: dropTable() not working when no database prefix set. - jaynarayan - 09-27-2017

It was big and fixed. https://github.com/bcit-ci/CodeIgniter4/pull/736