tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
808 stars 91 forks source link

inspect db can not with "TIMESTAMP, DECIMAL" #213

Open wenniao opened 2 years ago

wenniao commented 2 years ago

Hi, when i inspect my db to models, it happens error when parse field type: DECIMAL, TIMESTAMP, i modified "aerich/inspectdb.py", add these two field into sourcecode, then can continue.

but happen another error:

loop.run_until_complete(f(*args, **kwargs))

File "/home/sandbox/.pyenv/versions/3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/sandbox/.pyenv/versions/3.8.12/envs/fastapi/lib/python3.8/site-packages/aerich/cli.py", line 254, in inspectdb await command.inspectdb(table) File "/home/sandbox/.pyenv/versions/3.8.12/envs/fastapi/lib/python3.8/site-packages/aerich/init.py", line 112, in inspectdb await inspect.inspect() File "/home/sandbox/.pyenv/versions/3.8.12/envs/fastapi/lib/python3.8/site-packages/aerich/inspectdb.py", line 81, in inspect field = self._field_template_mapping[column.data_type].format( KeyError: 'UTF8_GENERAL_CI'