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

UNIQUE constraint failed: plans_plan.default #97

Open
sandeepbalagopal09 opened this issue Mar 23, 2019 · 2 comments
Open

UNIQUE constraint failed: plans_plan.default #97

sandeepbalagopal09 opened this issue Mar 23, 2019 · 2 comments

Comments

@sandeepbalagopal09
Copy link

UNIQUE constraint failed: plans_plan.default

this is the error getting while trying to load the fixture https://github.com/django-getpaid/django-plans/blob/master/demo/example/foo/fixtures/initial_data.json

Also the documentation is not up to date, it referes to syncdb command which does not exist in django now. I did migrate, and loaded the /initial_data.json and got above error.

@MAkcanca
Copy link

I think you might already have a "default" plan defined in your configuration. Try removing lines between here

{
"pk": 3,
"model": "plans.plan",
"fields": {
"available": true,
"visible": true,
"description": "Plan for small company",
"created": "2012-05-05T15:24:44Z",
"default": true,
"customized": null,
"order": 0,
"name": "Standard"
}
},
or, change "default": true to false.

@bezkos
Copy link

bezkos commented Mar 9, 2022

There is a unique constraint for "default" field that added after the creation of initial data file.
To fix this u need to change all instances of
"default": false
with
"default": null
for plans.plan model.

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

3 participants