Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DBForge add_column error. #1845

Closed
sjlu opened this Issue · 4 comments

3 participants

@sjlu

Get the following error using DBForge in migrations.

Using CI 2.1.2, Postgres 9.1.6

        $field = array(
            'read' => array(
                'type' => 'INT',
                'constraint' => 1,
                'unsigned' => TRUE,
                'default' => 0
            )
        );

        $this->dbforge->add_column('notifications', $fields);
ERROR: syntax error at or near "Array" LINE 1: ALTER TABLE "notifications" ADD Array NOT NULL ^
ALTER TABLE "notifications" ADD Array NOT NULL
@BennyC

I may be wrongly assuming here, please forgive me if I am!
In your above code your using $field as your array name, in the call your giving it $fields.

I'm guessing this might be a typo on your behalf in the issue, or is your source code identical?

@sjlu

Yeah, you're probably right that I had the typo. But I find it quite strange that it outputted an Array instead of NULL. I also swear that I saw MySQL put this row in on my environment. I'll test and come back.

@BennyC

Fully agree, I'll have a good look into it this evening. It should return false, or fail out in my opinion if such a thing happens!

Any other input on what the error outcome should be guys?

@narfbg
Owner

Fixed.

@narfbg narfbg closed this
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.