Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
DBUtil Migrate Issue
  • I'm still getting my head around migrations. Seems a really helpful tool. However when ever I user DBUtil::drop_table(); I keep getting the following message in the log:
    Error - 2011-01-29 19:40:18 --> Compile Error - Cannot redeclare class Fuel\Core\Database in /Users/steve/Sites/colophon/fuel/core/classes/database.php on line 18
    

    My Migration class is:
    <?php 
    namespace Fuel\Migrations;
    
    class Remove_Ttu {
    
        function up()
        {
           \DBUtil::drop_table('tag_to_urls');
        }
    
        function down()
        {
           \DBUtil::create_table('tag_to_urls', array(
                'id' => array('type' => 'int', 'constraint' => 5),
                'url' => array('type' => 'varchar', 'constraint' => 100),
                'tag' => array('type' => 'varchar', 'constraint' => 30)
            ), array('id'));
    
        }
    }
    
    

    Any help will be great. Cheers,
    Steve
  • Hi Steve, Might have been a bug in the DBUtil class at the time. Try updating to the latest code from github and see if that helps. So far as I can tell, your code looks correct. Let me know how you go :) Thomas
  • Suspect it's a bug in /fuel/core/classes/autoloader.php Need to test this issue.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion