big fix imports
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
from logging.config import fileConfig
|
||||
|
||||
from sqlalchemy import engine_from_config, event
|
||||
from sqlalchemy import pool
|
||||
from alembic import context
|
||||
from sqlalchemy import engine_from_config, event, pool
|
||||
|
||||
from src.core.database import Base
|
||||
from src.models import * # noqa
|
||||
|
||||
@@ -8,9 +8,8 @@ Create Date: 2025-07-06 00:02:09.254907
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "a2fdd0ec4a96"
|
||||
|
||||
@@ -8,9 +8,8 @@ Create Date: 2025-08-06 23:41:56.778423
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "197b195208e8"
|
||||
@@ -36,9 +35,9 @@ def upgrade():
|
||||
break
|
||||
|
||||
if constraint_name:
|
||||
try:
|
||||
try: # noqa: SIM105
|
||||
batch_op.drop_constraint(constraint_name, type_="foreignkey")
|
||||
except: # noqa E722
|
||||
except: # noqa E722
|
||||
pass
|
||||
|
||||
batch_op.create_foreign_key(
|
||||
@@ -49,9 +48,9 @@ def upgrade():
|
||||
def downgrade():
|
||||
"""Downgrade schema."""
|
||||
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
||||
try:
|
||||
try: # noqa: SIM105
|
||||
batch_op.drop_constraint("fk_tasks_user_id_users", type_="foreignkey")
|
||||
except: # noqa E722
|
||||
except: # noqa E722
|
||||
pass
|
||||
|
||||
batch_op.create_foreign_key(
|
||||
|
||||
@@ -6,11 +6,10 @@ Create Date: 2025-08-06 23:54:24.308488
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
from typing import Sequence, Union # noqa: UP035
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "4b0f3ea2fd26"
|
||||
@@ -31,9 +30,9 @@ def upgrade():
|
||||
|
||||
for fk in foreign_keys:
|
||||
if "user_id" in fk["constrained_columns"]:
|
||||
try:
|
||||
try: # noqa: SIM105
|
||||
batch_op.drop_constraint(fk["name"], type_="foreignkey")
|
||||
except: # noqa E722
|
||||
except: # noqa E722
|
||||
pass
|
||||
|
||||
batch_op.create_foreign_key(
|
||||
@@ -44,9 +43,9 @@ def upgrade():
|
||||
def downgrade():
|
||||
"""Downgrade schema."""
|
||||
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
||||
try:
|
||||
try: # noqa: SIM105
|
||||
batch_op.drop_constraint("fk_tasks_user_id_users", type_="foreignkey")
|
||||
except: # noqa E722
|
||||
except: # noqa E722
|
||||
pass
|
||||
batch_op.create_foreign_key(
|
||||
"fk_tasks_user_id_users", "users", ["user_id"], ["id"]
|
||||
|
||||
Reference in New Issue
Block a user