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

Tasks to seed and delete Neo4j database #11

Open
cheerfulstoic opened this issue Sep 22, 2015 · 6 comments
Open

Tasks to seed and delete Neo4j database #11

cheerfulstoic opened this issue Sep 22, 2015 · 6 comments

Comments

@cheerfulstoic
Copy link
Contributor

Originally from @dpisarewski in this issue:

neo4jrb/activegraph#793 (comment)

CC @jessmartin and @framallo

@andrewhavens
Copy link

It would be nice to have the same rake db:seed command so you don't have to remember the neo4j namespace.

@cheerfulstoic
Copy link
Contributor Author

I can see that, but what about when somebody is using both Neo4j.rb and ActiveRecord?

@andrewhavens
Copy link

ActiveRecord already defines the rake db:seed task to load the db/seed.rb file. So when using both AR and Neo4j, you don't have to do anything. It's only when AR is not being used that the rake task is missing. Simply define the db:seed task to work the same way (load the db/seed.rb file) and there is no issue using/not using AR.

@cheerfulstoic
Copy link
Contributor Author

Ah, fair point! ;)

@shobee
Copy link

shobee commented Sep 21, 2018

Since this issue is still open, here is a quick solution that works for me:

namespace :neo4j do
  desc "Load the seed data from db/seeds.rb"
  task :seed => [:environment] do
    Rails.application.load_seed
  end
end

@jktzes
Copy link

jktzes commented Sep 25, 2018

As far as I know, the seedbank gem, which does not depend on ActiveRecord, can be a good complement. It provides the same rake db:seed you asked.

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

4 participants