From 7cd1c12a4fc2c7ae5b7eb93125cfb222a8eaea1d Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 10 Dec 2018 14:14:49 +0100 Subject: [PATCH 1/2] Use built-in methods for Postgres extensions enabling [SCI-2864] --- app/helpers/database_helper.rb | 14 -------------- db/migrate/20151021082639_add_pg_trgm_support.rb | 8 +------- .../20151103155048_add_btree_gist_extension.rb | 8 +------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/app/helpers/database_helper.rb b/app/helpers/database_helper.rb index d9b325bb1..06677dda8 100644 --- a/app/helpers/database_helper.rb +++ b/app/helpers/database_helper.rb @@ -4,20 +4,6 @@ module DatabaseHelper ActiveRecord::Base.connection.adapter_name == adapter_name end - # Create PostgreSQL extension. PostgreSQL only! - def create_extension(ext_name) - ActiveRecord::Base.connection.execute( - "CREATE EXTENSION #{ext_name};" - ) - end - - # Drop PostgreSQL extension. PostgreSQL only! - def drop_extension(ext_name) - ActiveRecord::Base.connection.execute( - "DROP EXTENSION #{ext_name};" - ) - end - # Create gist trigram index. PostgreSQL only! def add_gist_index(table, column) ActiveRecord::Base.connection.execute( diff --git a/db/migrate/20151021082639_add_pg_trgm_support.rb b/db/migrate/20151021082639_add_pg_trgm_support.rb index f390b9986..5d1be1492 100644 --- a/db/migrate/20151021082639_add_pg_trgm_support.rb +++ b/db/migrate/20151021082639_add_pg_trgm_support.rb @@ -4,13 +4,7 @@ include DatabaseHelper class AddPgTrgmSupport < ActiveRecord::Migration[4.2] def up if db_adapter_is? "PostgreSQL" then - create_extension :pg_trgm - end - end - - def down - if db_adapter_is? "PostgreSQL" then - drop_extension :pg_trgm + enable_extension :pg_trgm end end end diff --git a/db/migrate/20151103155048_add_btree_gist_extension.rb b/db/migrate/20151103155048_add_btree_gist_extension.rb index ac4125317..ac67759ee 100644 --- a/db/migrate/20151103155048_add_btree_gist_extension.rb +++ b/db/migrate/20151103155048_add_btree_gist_extension.rb @@ -4,13 +4,7 @@ include DatabaseHelper class AddBtreeGistExtension < ActiveRecord::Migration[4.2] def up if db_adapter_is? "PostgreSQL" then - create_extension :btree_gist - end - end - - def down - if db_adapter_is? "PostgreSQL" then - drop_extension :btree_gist + enable_extension :btree_gist end end end From 86aa7e7d53f058388afce6b1fca74abe2461032b Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Tue, 11 Dec 2018 16:26:24 +0100 Subject: [PATCH 2/2] Add AWS cli to production docker image [SCI-2864] --- Dockerfile.production | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.production b/Dockerfile.production index f95743e4b..9bdbb4fea 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -6,6 +6,8 @@ RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ apt-get update -qq && \ apt-get install -y \ nodejs \ + groff-base \ + awscli \ postgresql-client \ netcat \ default-jre-headless \