Hi. I’m trying to wipe out my production server, and I want to know what I am doing wrong (apart from “trying to wipe out my production server” which sounds really wrong, but it’s not really in production yet, I am just working on a migration).
I am using the Discourse Docker installation, which a colleague installed for me.
This is what I tried:
root@discourse:/docker-app/discourse# ./launcher enter app root@discourse-app:/var/www/discourse# su - discourse discourse@discourse-app:~$ cd /var/www/discourse discourse@discourse-app:/var/www/discourse$ RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop db:create db:migrate PG::InsufficientPrivilege: ERROR: must be owner of database discourse : DROP DATABASE IF EXISTS "discourse" Couldn't drop database 'discourse' rake aborted!
So I went to check if this ownership was really like it says and I got this:
discourse@discourse-app:/var/www/discourse$ psql psql (10.5 (Ubuntu 10.5-2.pgdg16.04+1)) Type "help" for help. discourse=> SELECT d.datname as "Name", pg_catalog.pg_get_userbyid(d.datdba) as "Owner" FROM pg_catalog.pg_database d WHERE d.datname = 'discourse' ORDER BY 1; Name | Owner -----------+---------- discourse | postgres (1 row) discourse=>
So my questions would be…
Is it wrong not to have the database ownership set to
Did I do this setup error? Or maybe my colleague. But what I mean to ask is: isn’t this something that comes with the Docker container provided?
How to go past this roadblock?
Thanks in advance for any help!