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

let constants be seeded multiple times whithout be duplicated #1094

Closed
wants to merge 1 commit into from
Closed

Conversation

lalop
Copy link
Member

@lalop lalop commented Oct 5, 2016

I found 100 times the themes readable in my database ( the same for the other themes in constantsseeder ).
Bu it seems that the only point where this value is inserted into the database is in this file.
So I assume this is run multiple times.
Changing create by firtsOrCreate should avoid issue du to multiple times playing this seed.

I found 100 times the themes `readable` in my database ( the same for the other themes in constantsseeder ).
Bu it seems that the only point where this value is inserted into the database is in this file.
So I assume this is run multiple times.
Changing `create` by `firtsOrCreate` should avoid issue du to multiple times playing this seed.
@hillelcoren
Copy link
Member

Thanks for the change!

Rather than check for each row can you add a single check at the top, this approach would generate many extra queries.

Also, please create the PR against the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants