tortoise / aerich

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

aerich inspectdb makes syntax error #321

Open MichaelTsao opened 10 months ago

MichaelTsao commented 10 months ago

when table's create sql like below:

CREATE TABLE one_table (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(255) DEFAULT ''
);

aerich inspectdb will make the model code like below:

class OneTable(Model):
    id = fields.IntField(pk=True, )
    name = fields.CharField(max_length=1000, default=, )

default=, is a syntax error