S
S
Sasha Zhelezovsky2016-01-05 17:58:16
Doctrine ORM
Sasha Zhelezovsky, 2016-01-05 17:58:16

How to create a query to create a table in DOCTRINE2 with a DEFAULT now() type field?

You should get a query like this:

CREATE TABLE tbl
(
  id integer NOT NULL,
  date_added timestamp with time zone NOT NULL DEFAULT now(),
);

when executing orm:schema-tool:update -f now() , it makes the date_added field default to the table creation date at the time of orm:schema-tool:update

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Chernyshev, 2016-01-05
@goper

columnDefinition

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question