How can I get Gedmo\Timestampable to keep updated_at null on first create?
<p>I've got a Symfony 2.8 app which uses The <code>Gedmo\Timestampable</code> annotations for automatic <code>created_at</code> and <code>updated_at</code> operations, but it seems to be putting the same timestamp into the <code>updated_at</code> column when the entity/row is first created. An <code>UPDATE</code> does cause the <code>updated_at</code> column to show a newer timestamp, but I want this to be blank to begin with.</p>

<p>My understanding is that on an <code>INSERT</code>, only the <code>created_at</code> column should be populated with the timestamp and the <code>updated_at</code> should stay blank, because it hasn't been updated as such. Only after the first update of the column should it get the value of the updating time.</p>

<p>Am I correct in expecting this? Is there something wrong with my code/config? Or does this annotation actually set the values for both columns by design?</p>

<p>My <code>config.yml</code>:</p>

<pre><code>...
stof_doctrine_extensions:
    default_locale: "%locale%"
    translation_fallback: true
    orm:
        default:
            translatable: true
            timestampable: true
...
</code></pre>

<p>My entity:</p>

<pre><code>...
/**
 * An automatic timestamp of the creation.
 *
 * @var \DateTime $createdAt
 * @Gedmo\Timestampable(on="create")
 * @ORM\Column(name="created_at", type="datetime")
 */
public $createdAt;

/**
 * An automatic timestamp of the updation. 
 *
 * @var \DateTime $updatedAt
 * @Gedmo\Timestampable(on="update")
 * @ORM\Column(name="updated_at", type="datetime")
 */
protected $updatedAt;
...
</code></pre>

<p>The table defines the two columns as <code>DATETIME</code> and they have no default clauses.</p>