]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Do not CAST(x as JSON) in SQLite
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 1 Jun 2020 13:38:12 +0000 (09:38 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Jun 2020 20:01:51 +0000 (16:01 -0400)
commit9daaaf82e0895a54883609ea0777563929b2ae3b
tree674a2fa14dc668bd32f6f0053209c2fcc96b7a0e
parent58f36f87c45f7dcf4a71142645dd95af45d05b0a
Do not CAST(x as JSON) in SQLite

Fixed issue where the CAST applied to a JSON column when copying a SQLite
table during batch mode would cause the data to be lost, as SQLite's CAST
with JSON appears to convert the data to the value "0". The CAST is now
skipped in a dialect-specific manner, including for JSON columns on SQLite.
Pull request courtesy Sebastián Ramírez.

Fixes: #697
Closes: #698
Pull-request: https://github.com/sqlalchemy/alembic/pull/698
Pull-request-sha: 6618325258bd90ec257b09c17d44421a5642b1b1

Change-Id: Ia152ea7386e64efb2194aa836dc57754f979e204
alembic/ddl/impl.py
alembic/ddl/sqlite.py
alembic/operations/batch.py
docs/build/unreleased/697.rst [new file with mode: 0644]
tests/test_batch.py