fix: inspectdb not match data type 'DOUBLE' and 'CHAR' for MySQL
* increase: 1. Inspectdb adds DECIMAL, DOUBLE, CHAR, TIME data type matching; 2. Add exception handling, avoid the need to manually create the entire table because a certain data type is not supported. * fix: aerich inspectdb raise KeyError for double in MySQL * feat: support command `python -m aerich` * docs: update changelog * tests: verify mysql inspectdb for float field * fix mysql uuid field inspect to be charfield * refactor: use `db_index=True` instead of `index=True` for inspectdb * docs: update changelog --------- Co-authored-by: xiechen <xiechen@jinse.com> Co-authored-by: Waket Zheng <waketzheng@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import contextlib
|
||||
import os
|
||||
import platform
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -72,7 +73,12 @@ class Dialect:
|
||||
return not cls.test_db_url or "sqlite" in cls.test_db_url
|
||||
|
||||
|
||||
WINDOWS = platform.system() == "Windows"
|
||||
|
||||
|
||||
def run_shell(command: str, capture_output=True, **kw) -> str:
|
||||
if WINDOWS and command.startswith("aerich "):
|
||||
command = "python -m " + command
|
||||
r = subprocess.run(shlex.split(command), capture_output=capture_output)
|
||||
if r.returncode != 0 and r.stderr:
|
||||
return r.stderr.decode()
|
||||
|
||||
Reference in New Issue
Block a user