diff --git a/config/initializers/apartment.rb b/config/initializers/apartment.rb index a2647571d..53934a77b 100644 --- a/config/initializers/apartment.rb +++ b/config/initializers/apartment.rb @@ -12,7 +12,7 @@ # Add any models that you do not want to be multi-tenanted, but remain in the global (public) namespace. # A typical example would be a Customer or Tenant model that stores each Tenant's information. - config.excluded_models = %w{ Account AccountCrossSearch DomainName Endpoint User UserStat SolrEndpoint FcrepoEndpoint RedisEndpoint } + config.excluded_models = %w{ Account AccountCrossSearch DomainName Endpoint User UserStat SolrEndpoint FcrepoEndpoint RedisEndpoint GoodJob::Execution GoodJob::Job GoodJob::Process } # In order to migrate all of your Tenants you need to provide a list of Tenant names to Apartment. # You can make this dynamic by providing a Proc object to be called on migrations. diff --git a/db/migrate/20230406183810_setup_good_jobs_schema.rb b/db/migrate/20230406183810_setup_good_jobs_schema.rb new file mode 100644 index 000000000..5ffdffee0 --- /dev/null +++ b/db/migrate/20230406183810_setup_good_jobs_schema.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This migration pre-sets the shared_extensions schema for in prep for good_jobs +class SetupGoodJobsSchema < ActiveRecord::Migration[5.2] + def change + # Create Schema + ActiveRecord::Base.connection.execute 'CREATE SCHEMA IF NOT EXISTS shared_extensions;' + # Enable Hstore + ActiveRecord::Base.connection.execute 'CREATE EXTENSION IF NOT EXISTS HSTORE SCHEMA shared_extensions;' + # Enable UUID-OSSP + ActiveRecord::Base.connection.execute 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp" SCHEMA shared_extensions;' + ActiveRecord::Base.connection.execute 'CREATE EXTENSION IF NOT EXISTS "pgcrypto" SCHEMA shared_extensions;' + # Grant usage to public + ActiveRecord::Base.connection.execute 'GRANT usage ON SCHEMA shared_extensions to public;' + end +end diff --git a/db/schema.rb b/db/schema.rb index c523cfd22..c2b964beb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -13,8 +13,10 @@ ActiveRecord::Schema.define(version: 2023_08_04_073106) do # These are extensions that must be enabled in order to support this database + enable_extension "hstore" enable_extension "pgcrypto" enable_extension "plpgsql" + enable_extension "uuid-ossp" create_table "account_cross_searches", force: :cascade do |t| t.bigint "search_account_id" diff --git a/docker-compose.yml b/docker-compose.yml index e618b5c47..f23f27273 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -135,7 +135,7 @@ services: web: <<: *app - # Uncomment command to access container with out starting Rails. Useful for debugging + # Uncomment command to access container with out starting bin/web. Useful for debugging # command: sleep infinity environment: - VIRTUAL_PORT=3000 @@ -167,6 +167,8 @@ services: worker: <<: *app image: ghcr.io/samvera/hyku/worker:${TAG:-latest} + # Uncomment command to access container with out starting bin/worker. Useful for debugging + # command: sleep infinity build: context: . target: hyku-worker @@ -176,7 +178,6 @@ services: - ghcr.io/samvera/hyku/base:latest - ghcr.io/samvera/hyku:latest - ghcr.io/samvera/hyku/worker:latest - command: bundle exec sidekiq depends_on: check_volumes: condition: service_completed_successfully