Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

migration ::down() cannot be called statically #2037

Closed
hakimihamdan88 opened this Issue · 8 comments

2 participants

@hakimihamdan88

5.2.x php

Severity: Runtime Notice

Message: Non-static method Migration_Modify_column_title::down() cannot be called statically

Filename: libraries/Migration.php
class Migration_Modify_column_title extends CI_Migration {

    public function up()
    {
        $fields = array(
            'title' => array(
                    'name' => 'title',
                    'type' => 'VARCHAR',
                    'constraint' => 250
            )
        );

        $this->dbforge->modify_column('news', $fields);
    }

    public function down()
    {
    }
}
@narfbg
Owner

Could you show the code that runs it?

@hakimihamdan88

do you mean this ?

class Migration_Modify_column_title extends CI_Migration {

    public function up()
    {
        $fields = array(
            'title' => array(
                    'name' => 'title',
                    'type' => 'VARCHAR',
                    'constraint' => 250
            )
        );

        $this->dbforge->modify_column('news', $fields);
    }

    public function down()
    {
    }
}
@narfbg
Owner

You already had that code shown, why would I want you to post it again?
I mean your actual call to the down() method.

@hakimihamdan88

thats the only code

@narfbg
Owner

This can't be the only code. You need to call this class somehow, probably in a controller.

@hakimihamdan88

autoload migration library

@narfbg
Owner

The Migration library doesn't have any static calls.

Could you please be a bit more descriptive, at least once? It almost looks like you've intentionally cut the Line number part of the E_NOTICE that you're getting. And your obscure comments aren't helping.

I realize that sounds harsh, but you're posting as a bug every single problem that you have and you're never giving any relevant information.

@narfbg narfbg closed this issue from a commit
@narfbg narfbg Fix #2037 e1d6c46
@narfbg narfbg closed this in e1d6c46
@nonchip nonchip referenced this issue from a commit in nonchip/CodeIgniter
@narfbg narfbg Fix #2037 5b9be19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.