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
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.
1 Comment
bcan001
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 :)