From 0be5c1b5456293d1dd231d31ef52306506ca0933 Mon Sep 17 00:00:00 2001 From: alistairmaclean <34235348+alistairmaclean@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:09:04 +0100 Subject: [PATCH] Remove system dependency on libsqlite3.so on command.upgrade (#413) * Remove system dependency on libsqlite3.so on command.upgrade * Fix styling using `make style` command --- aerich/ddl/__init__.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/aerich/ddl/__init__.py b/aerich/ddl/__init__.py index 50d2ea5..de76ae8 100644 --- a/aerich/ddl/__init__.py +++ b/aerich/ddl/__init__.py @@ -5,7 +5,6 @@ from typing import Any, List, Type, cast import tortoise from tortoise import BaseDBAsyncClient, Model from tortoise.backends.base.schema_generator import BaseSchemaGenerator -from tortoise.backends.sqlite.schema_generator import SqliteSchemaGenerator from aerich.utils import is_default_function @@ -128,11 +127,7 @@ class BaseDDL: template = self._MODIFY_COLUMN_TEMPLATE else: # sqlite does not support alter table to add unique column - unique = ( - " UNIQUE" - if field_describe.get("unique") and self.DIALECT != SqliteSchemaGenerator.DIALECT - else "" - ) + unique = " UNIQUE" if field_describe.get("unique") and self.DIALECT != "sqlite" else "" template = self._ADD_COLUMN_TEMPLATE column = self.schema_generator._create_string( db_column=db_column,