Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hakimihamdan88 opened this issue Nov 28, 2012 · 8 comments
Closed

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

hakimihamdan88 opened this issue Nov 28, 2012 · 8 comments

Comments

@hakimihamdan88
Copy link

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
Copy link
Contributor

narfbg commented Nov 28, 2012

Could you show the code that runs it?

@hakimihamdan88
Copy link
Author

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
Copy link
Contributor

narfbg commented Nov 28, 2012

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
Copy link
Author

thats the only code

@narfbg
Copy link
Contributor

narfbg commented Nov 28, 2012

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

@hakimihamdan88
Copy link
Author

autoload migration library

@narfbg
Copy link
Contributor

narfbg commented Nov 28, 2012

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.

@hakimihamdan88
Copy link
Author

you can see the log http://i.imgur.com/Ki9h5.png

@narfbg narfbg closed this as completed in e1d6c46 Nov 28, 2012
nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants