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

Error if Default column value is CURRENT_TIMESTAMP #1

Closed
Insolita opened this issue Jul 26, 2014 · 1 comment
Closed

Error if Default column value is CURRENT_TIMESTAMP #1

Insolita opened this issue Jul 26, 2014 · 1 comment

Comments

@Insolita
Copy link
Contributor

(tested with mysql table only)
For fix in AppUtility.php

private function runMySql()
        {
            if ( isset($this->array['dbType']) )
                $this->string .= $this->Tab . "'{$this->array['name']}' => '" . strtoupper($this->array['dbType']) . "";
            if ( isset($this->array['allowNull']) )
                $this->string .= ($this->array['allowNull']) ? ' NULL' : ' NOT NULL';
            if ( isset($this->array['autoIncrement']) )
                $this->string .= ($this->array['autoIncrement']) ? ' AUTO_INCREMENT' : '';
            if ( isset($this->array['defaultValue']) )
                if(!is_array($this->array['defaultValue'])){
                    $this->string .= (empty($this->array['defaultValue'])) ? '' : " DEFAULT \'{$this->array['defaultValue']}\'";
                }else{
                    $this->string .= (empty($this->array['defaultValue'])) ? '' : " DEFAULT ".$this->array['defaultValue']['expression']." ";
                }
        }
@c006
Copy link
Owner

c006 commented Jul 27, 2014

Thank you, updated.

@c006 c006 closed this as completed Jul 27, 2014
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