Welcome Guest, Not a member yet? Register   Sign In
addColumn IF NOT EXITS


I'm new in codeigniter. And yes I read the manual about forge and addColumn. Smile

My Question is:
When you add a table with forge you can check if table exists when you add a TRUE in your Line like written in the manual.

Is there also an option to check if a column I want to add exists?

PHP Code:
    public function updateDatabase() {
      $forge = \Config\Database::forge();

        $addresses = ['sort' => ['type' => 'INT''constraint' => '100''null' => true'after' => 'person_idperson', ],];

When I update my page twice I got a Error Message "duplicated column name"

Any Idea how to solve that?


Use migrations to change the database table.

ok thx I will try....

Theme © iAndrew 2016 - Forum software by © MyBB