-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
manage.py loaddata crashes with postgres when filling id column of cms_placeholder #3193
Comments
Which version of django CMS are you using? |
I'am using an old one: django-cms==2.3.5, as required by Arkestra. |
It should be fixed in 2.3.8 |
staaas
added a commit
to kinaklub/filmfest.by
that referenced
this issue
Oct 10, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See Arkestra #122 evildmp/Arkestra#122
When the database used is PostgreSQL, the command "manage.py loaddata example_database.json" crashes if the file "example_database.json" contains the block
{
"pk": 1,
"model": "cms.placeholder",
"fields": {
"slot": "body",
"default_width": null
}
},
The crash occurs in the the method Page.rescan_placeholders() (file cms/models/pagemodel.py) because it fills an autoindexed row with an index not taking into account the already filled rows. The problem is clearly decribed here:
http://jesiah.net/post/23173834683/postgresql-primary-key-syncing-issues
and a possible workaround is to insert:
from django.db import connection
cursor = connection.cursor()
cursor.execute("SELECT setval('cms_placeholder_id_seq', (SELECT MAX(id) FROM cms_placeholder)+1)")
But a better way can be certainly found.
The text was updated successfully, but these errors were encountered: