Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

TIMESTAMP DEFAULT NULL

How create column TIMESTAMP DEFAULT NULL?

new Column('created_at', [
    'type' => Column::TYPE_TIMESTAMP,
    'notNull' => false
]),

not work

new Column('created_at', [
    'type' => Column::TYPE_TIMESTAMP,
    'notNull' => false,
    'default' => "NULL"
]),

not work too



7.9k
Accepted
answer
edited Nov '16

use a raw value

new Column('created_at', [
    'type' => new RawValue('default'),
    'notNull' => false,
    'default' => "NULL"
]),

https://docs.phalconphp.com/en/latest/reference/models.html#skipping-columns