jazzband / django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
GNU Affero General Public License v3.0
846 stars 204 forks source link

Message primary key error. #386

Open trexmo opened 1 year ago

trexmo commented 1 year ago

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 commented 1 year ago

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