I am trying to drop my production postgresql database but apparently, there are some processes that stop me. I host in DigitalOcean on Ubuntu 14.04 with nginx and puma.
The code I try in the console:
RAILS_ENV=production bundle exec rails db:drop DISABLE_DATABASE_ENVIRONMENT_CHECK=1
The error I get:
PG::ObjectInUse: ERROR: database "****_production" is being accessed by other users
DETAIL: There are 5 other sessions using the database.
/home/deploy/sites/***/shared/bundle/ruby/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in `async_exec'
Any idea how to stop all processes and reset the database?