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 generates two semicolons in a row #301

Open neo31337 opened 1 year ago

neo31337 commented 1 year ago
async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        CREATE TABLE IF NOT EXISTS `languages` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `code` VARCHAR(2) NOT NULL
) CHARACTER SET utf8mb4;;
        CREATE TABLE IF NOT EXISTS `timezones` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `country_code` VARCHAR(2) NOT NULL,
    `country_name` VARCHAR(255) NOT NULL,
    `timezone` VARCHAR(255) NOT NULL,
    `gmt_offset` VARCHAR(255) NOT NULL
) CHARACTER SET utf8mb4;;"""

tortoise.exceptions.OperationalError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';\n CREATE TABLE IF NOT EXISTS timezones (\n id INT NOT NULL PRIMARY' at line 1")

long2ice commented 1 year ago

Just try latest code

Serpong commented 11 months ago

I have same problem here. I found that this problem has fixed on #280 But latest released version is still 0.7.1 (Sep 27, 2022) 😭

long2ice commented 11 months ago

released v0.7.2