summaryrefslogtreecommitdiff
path: root/alembic/ddl
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-11-13 10:27:30 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-14 21:32:08 -0500
commitf0bd40faf85ae3101a3306e72ccacd713362c2a6 (patch)
treebbe342a6c86cb3a34c77c0f8bc5f37f56c56dfe6 /alembic/ddl
parentbb2cf1e56cbc443dc96e80f7d6c32929330bf89e (diff)
downloadalembic-f0bd40faf85ae3101a3306e72ccacd713362c2a6.tar.gz
add type synonym for mysql.LONGTEXT / JSON
Added a rule to the MySQL impl so that the translation between JSON / LONGTEXT is accommodated by autogenerate, treating LONGTEXT from the server as equivalent to an existing JSON in the model. Change-Id: Ia8370d2269c4decea00aa94beafd3d9d861a1269 Fixes: #968
Diffstat (limited to 'alembic/ddl')
-rw-r--r--alembic/ddl/mysql.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/alembic/ddl/mysql.py b/alembic/ddl/mysql.py
index 9489560..c3d66bd 100644
--- a/alembic/ddl/mysql.py
+++ b/alembic/ddl/mysql.py
@@ -38,7 +38,10 @@ class MySQLImpl(DefaultImpl):
__dialect__ = "mysql"
transactional_ddl = False
- type_synonyms = DefaultImpl.type_synonyms + ({"BOOL", "TINYINT"},)
+ type_synonyms = DefaultImpl.type_synonyms + (
+ {"BOOL", "TINYINT"},
+ {"JSON", "LONGTEXT"},
+ )
type_arg_extract = [r"character set ([\w\-_]+)", r"collate ([\w\-_]+)"]
def alter_column( # type:ignore[override]