0

I am trying to delete an instance from a Post model on a Heroku database. From the command line, should 'heroku run Post.first.delete' work? I've been trying this and it doesn't seem to work and I can't find how to do this. All help is appreciated.

1 Answer 1

1

heroku run X won't directly put you into a Rails console.

As per this article you'll want:

heroku run rails console

From there you can delete records.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I also figured out that I can use heroku and psql to get into the database and run SQL commands, from the command line. I'd prefer to do this with an ORM as you mentioned though. thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.