How to define current timestamp in yaml with doctrine?

前端 未结 7 1103
灰色年华
灰色年华 2020-12-09 18:41

I tried the following yaml code:

columns:
  created_time:
    type: timestamp
    notnull: true
    default: default CURRENT_TIMESTAMP

In

7条回答
  •  死守一世寂寞
    2020-12-09 18:54

    /**
     * @var int
     * @ORM\Column(type="datetime", columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
     */
    protected $created;
    

    after run ./vendor/bin/doctrine-module orm:schema-tool:update --force

    Updating database schema... Database schema updated successfully! "1" queries were executed

    and run ./vendor/bin/doctrine-module orm:validate-schema

    [Mapping] OK - The mapping files are correct. [Database] FAIL - The database schema is not in sync with the current mapping file.

    But FAIL for sync appear

提交回复
热议问题