marian33

V migrácii mám

$table->timestamp('plot_date')

ale takto vyzera create script

`plot_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),

Neviem prečo to preloží takto, keď nikde nič také nezadávam. Poraďťe prosím ako vytvoriť stĺpec bez current_timestamp. Dakujem

Ešte nie si členom CZ/SK Laravel komunity?

To možeš ľahko zmeniť. Registrácia je zdarma a ako registrovaný člen získaš množstvo výhod. Prečítaj si prečo by si mal byť členom.

Prihlásiť sa Zaregistrovať
Zoradiť odpovede:
xvital
by @xvital (460), pred 4 rokmi

Ahoj.

Nie je to sposobene frameworkom a nejedna sa o chybu. Toto spravanie naozaj zodpoveda specifikacii MySQL, pokial nie je uvedeny default. Riesenim je pouzit default.

In a CREATE TABLE statement, the first TIMESTAMP column can be declared in any of the following ways:

  • With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.
  • With neither DEFAULT nor ON UPDATE clauses, it is the same as DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP.
  • With a DEFAULT CURRENT_TIMESTAMP clause and no ON UPDATE clause, the column has the current timestamp for its default value but is not automatically updated.
  • With no DEFAULT clause and with an ON UPDATE CURRENT_TIMESTAMP clause, the column has a default of 0 and is automatically updated.
  • With a constant DEFAULT value, the column has the given default and is not automatically initialized to the current timestamp. If the column also has an ON UPDATE CURRENT_TIMESTAMP clause, it is automatically updated; otherwise, it has a constant default and is not automatically updated.

Kompletne info: http://download.nust.na/pub6/mysql/doc/refman/5.4/en/timestamp.html

DarinRaifs
by @DarinRaifs (15), pred 11 mesiacmi

You were visited with simply brilliant idea

sassa

DarinRaifs
by @DarinRaifs (15), pred 11 mesiacmi

I think, that you commit an error. I suggest it to discuss. Write to me in PM, we will communicate.

sassa

DarinRaifs
by @DarinRaifs (15), pred 11 mesiacmi

It is remarkable, rather useful message

sassa