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

Skip the row that violates 'unique' constraint #2

Closed
chfw opened this issue Jun 4, 2015 · 0 comments
Closed

Skip the row that violates 'unique' constraint #2

chfw opened this issue Jun 4, 2015 · 0 comments

Comments

@chfw
Copy link
Member

chfw commented Jun 4, 2015

if a column of table had 'unique' and a few row of your import data got 'None' for it, django will complain the value of this column may not be NULL. This complaint stops bulk import. Nothing got imported.The solution is to try import one by one. Yes, it will be slow if you have large data.

So, unless you make sure no violation before import, you will not hit this issue and will enjoy the speed of bulk_create.

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