Skip to content

Commit

Permalink
[NOREF] Clean Minio files when using db:clean (#2701)
Browse files Browse the repository at this point in the history
Clean Minio files when using db:clean
  • Loading branch information
ClayBenson94 committed Jul 16, 2024
1 parent 4f3a042 commit 8532c57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/dev
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ namespace :db do
end

# Make sure this list of tables matches the list in pkg/storage/truncate.go
desc "Deletes all rows from all tables"
desc "Deletes all rows from all tables and all files in Minio (S3)"
task :clean do
tables = %w{
cedar_system_bookmarks
Expand Down Expand Up @@ -391,6 +391,10 @@ namespace :db do
sql = tables.map { |table| "DELETE FROM #{table};" }.join
puts "Cleaning database..."
`echo "#{sql}" | psql`

# Delete all files from Minio
puts "Cleaning Minio file storage..."
`docker-compose run --entrypoint='mc --quiet rm -r --force local/easi-app-file-uploads/' minio_mc > /dev/null 2>&1`
end
end

Expand Down

0 comments on commit 8532c57

Please sign in to comment.