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

Error migrating - db_table 'django_redirect' is used by multiple models #35

Open
carderm opened this issue Aug 20, 2020 · 2 comments
Open
Assignees

Comments

@carderm
Copy link

carderm commented Aug 20, 2020

Hi - not sure if I'm missing something, but if there are already redirects in the db then this fails. Should it use a separate table?
Cheers.

ERRORS:
django_redirect: (models.E028) db_table 'django_redirect' is used by multiple models: djangocms_redirect.Redirect, redirects.Redirect.
djangocms_redirect.Redirect.site: (fields.E304) Reverse accessor for 'Redirect.site' clashes with reverse accessor for 'Redirect.site'.
	HINT: Add or change a related_name argument to the definition for 'Redirect.site' or 'Redirect.site'.
redirects.Redirect.site: (fields.E304) Reverse accessor for 'Redirect.site' clashes with reverse accessor for 'Redirect.site'.
	HINT: Add or change a related_name argument to the definition for 'Redirect.site' or 'Redirect.site'.
@yakky
Copy link
Member

yakky commented Aug 20, 2020

Yes currently djangocms-redirect share the same table as django redirect, for historical reason

We can lift this restriction, but I don't think we can apply if django redirect has already been added

@carderm
Copy link
Author

carderm commented Aug 24, 2020

Yeah - it looks like this is impossible to install except on a brand new system, or with django_redirects table completely removed.
Even doing --fake-intial migration doesn't work as you miss out on the 'response_code' field.
I would suggest blanking out the first 3 migrations and adding a new djangocms_redirects table migration > followed by another migration copying over any existing rows and matching columns... sorry I haven't got time to fix this, otherwise I'd help out. :)

@yakky yakky self-assigned this Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants