diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-06-29 14:35:22 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-06-29 14:57:31 -0400 |
| commit | a2c2dcaf082ecf97c7e06cd23adf5a614b5a4a2b (patch) | |
| tree | b01c2bdc18338ed47263d941f089db5d5181ef97 /doc | |
| parent | 5f5b56d646f154ee572c9de80449423304103bad (diff) | |
| download | sqlalchemy-a2c2dcaf082ecf97c7e06cd23adf5a614b5a4a2b.tar.gz | |
Docuemnt current workarounds for MySQL TIMESTAMP
MySQL 8 no longer generates the DEFAULT or ON UPDATE
clauses for TIMESTAMP by default, hence users will begin to hit
this regularly. add warnings that this non-standard SQL is not
accommodated by server_onupdate and docuemnt the workaround
used in issues such as #4652.
Fixes: #5427
Change-Id: Ie048dcc91c648dd0b80ed395208c1d665b6c968b
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/core/defaults.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/build/core/defaults.rst b/doc/build/core/defaults.rst index 3d6124b43..3884faa86 100644 --- a/doc/build/core/defaults.rst +++ b/doc/build/core/defaults.rst @@ -292,6 +292,8 @@ behaviors such as seen with TIMESTAMP columns on some platforms, as well as custom triggers that invoke upon INSERT or UPDATE to generate a new value, may be called out using :class:`.FetchedValue` as a marker:: + from sqlalchemy.schema import FetchedValue + t = Table('test', meta, Column('id', Integer, primary_key=True), Column('abc', TIMESTAMP, server_default=FetchedValue()), @@ -312,6 +314,13 @@ returned. For details on using :class:`.FetchedValue` with the ORM, see :ref:`orm_server_defaults`. +.. warning:: The :paramref:`_schema.Column.server_onupdate` directive + **does not** currently produce MySQL's + "ON UPDATE CURRENT_TIMESTAMP()" clause. See + :ref:`mysql_timestamp_onupdate` for background on how to produce + this clause. + + .. seealso:: :ref:`orm_server_defaults` |
