# Database Cleanup while writing a new Import Script

**URL:** <https://meta.discourse.org/t/database-cleanup-while-writing-a-new-import-script/94134>\
**Category:** Development\
**Created:** [07.Август.2018 16:59:17 UTC](https://meta.discourse.org/t/database-cleanup-while-writing-a-new-import-script/94134 "2018-08-07T16:59:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)\
**Post date:** [23.Октябрь.2018 05:04:18 UTC](https://meta.discourse.org/t/database-cleanup-while-writing-a-new-import-script/94134/6 "2018-10-23T05:04:18Z")

</div>

thanks!  
I got these error in docker:

> ```
> root@infdis-app:/var/www/discourse# bundle exec rake db:drop db:create db:migrate DISABLE_DATABASE_ENVIRONMENT_CHECK=1
> ===========================================
> DEPRECATION: The cocaine gem is deprecated. Please upgrade to terrapin. See https://github.com/thoughtbot/terrapin/ for further instructions.
> ===========================================
> PG::InsufficientPrivilege: ERROR: must be owner of database discourse
> : DROP DATABASE IF EXISTS "discourse"
> Couldn't drop database 'discourse'
> rake aborted!
> 
> ```

but after I su - discourse, I got another error:

> ```
> discourse@infdis-app:/var/www/discourse$ bundle exec rake db:drop db:create db:migrate DISABLE_DATABASE_ENVIRONMENT_CHECK=1
> ===========================================
> DEPRECATION: The cocaine gem is deprecated. Please upgrade to terrapin. See https://github.com/thoughtbot/terrapin/ for further instructions.
> ===========================================
> rake aborted!
> Errno::EACCES: Permission denied @ rb_sysopen - /var/www/discourse/tmp/ember-rails/ember.js
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/database-cleanup-while-writing-a-new-import-script/94134)._
