Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete m2m relation #312

Open
Maksim-Burtsev opened this issue Jul 28, 2023 · 1 comment
Open

Can't delete m2m relation #312

Maksim-Burtsev opened this issue Jul 28, 2023 · 1 comment

Comments

@Maksim-Burtsev
Copy link

I have m2m relation between two tables (and table already exists in the database with default name 'model1_model2').
But after i remove this relation and run aerich migrate i have error:

    return f(get_current_context(), *args, **kwargs)
  File "/Users/zadro/yuco/yuco-backend/venv/lib/python3.10/site-packages/aerich/cli.py", line 31, in wrapper
    loop.run_until_complete(f(*args, **kwargs))
  File "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/zadro/yuco/yuco-backend/venv/lib/python3.10/site-packages/aerich/cli.py", line 86, in migrate
    ret = await command.migrate(name)
  File "/Users/zadro/yuco/yuco-backend/venv/lib/python3.10/site-packages/aerich/__init__.py", line 121, in migrate
    return await Migrate.migrate(name)
  File "/Users/zadro/yuco/yuco-backend/venv/lib/python3.10/site-packages/aerich/migrate.py", line 140, in migrate
    cls.diff_models(cls._last_version_content, new_version_content)
  File "/Users/zadro/yuco/yuco-backend/venv/lib/python3.10/site-packages/aerich/migrate.py", line 243, in diff_models
    table = change[0][1].get("through")
AttributeError: 'str' object has no attribute 'get'

I was tried everything from this issue #150 but nothing helps me.

@long2ice Is it possible to remove this relation by aerich or it will stay forever?

@catarium
Copy link

catarium commented Jul 30, 2023

you can install the previous version of aerich (0.7.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants