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

Message primary key error. #386

Open
trexmo opened this issue Jan 13, 2023 · 1 comment
Open

Message primary key error. #386

trexmo opened this issue Jan 13, 2023 · 1 comment

Comments

@trexmo
Copy link

trexmo commented Jan 13, 2023

After following the installation steps through to getting logged in, creating a user, creating a newsletter, then trying to add a message, I got an error that Message needs a primary key value before it can be used. I am using SQLite.

I Changed settings to add

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

and makemigrations, migrate, and checked the database. Deleted the newsletter, and subscription and user. Then recreated a user, newsletter and subscription, still gives same primary key value error on the message add. I added id = models.BIgAutoField(primarykey=True, default=(milliseconds since epoch)) now working, for one or two messages but I know this is not a solution.

@trexmo
Copy link
Author

trexmo commented Feb 4, 2023

I thought BigAutoField would satisfy the requirement but apparently not. Maybe it is a limitation related to sqlite

@trexmo trexmo changed the title Message foreign key error. Message primary key error. Feb 7, 2023
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

1 participant