Coder Social home page Coder Social logo

Comments (5)

pjrobertson avatar pjrobertson commented on July 23, 2024

I 'fixed' my issue by just blindly deleting the table in the DB:

drop table registration_registrationprofile;

I have no idea of the implications of this though. If it's fine, then this should be added as a migration to django_registration>=3.0

from django-registration.

ubernostrum avatar ubernostrum commented on July 23, 2024

The problem with adding a migration for this is that some people might want to keep a historical table around with the data, and adding a migration more or less forces that table and all its data to drop at the next run of manage.py migrate. So I donโ€™t think Iโ€™ll be adding a migration to drop that table. Documenting what to do with it in the upgrade notes is a possibility, though.

from django-registration.

pjrobertson avatar pjrobertson commented on July 23, 2024

Keeping the table around makes sense, but in that case I think the table should decouple itself from the user model table (somehow removing the foreign key requirement on the). Another solution would just be to add an on_delete=models.SET_NULL for the RegistrationProfile model.

Basically, the issue that I hope we can solve is: if I try to delete a user after upgrading to django_registration>=3.0, I should still be able to delete.

from django-registration.

ubernostrum avatar ubernostrum commented on July 23, 2024

The bigger problem is that as of 3.0, django-registration itself no longer ships any models or migrations at all. Adding them at this point would just introduce confusion for people who have already been on 3.x versions for several years (django-registration 3.0 was released in 2018) and would wonder why there are suddenly migrations. So again, I don't think django-registration will be adding a migration at this point. Installations that run into issues can manually generate their own migration to do what they want with the table -- whether that's dropping it, changing the ON DELETE behavior, or something else entirely.

from django-registration.

pjrobertson avatar pjrobertson commented on July 23, 2024

I ultimately 'solved' this problem without deleting the registrationprofile table by dropping the foreign key requirement:

alter table registration_registrationprofile drop constraint registration_registrationprofile_user_id_fkey;

Perhaps this can be added to the docs?

from django-registration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.