Skip to content

Commit d279eca

Browse files
committed
Set up Salesforce Connect database connection
1 parent 771d1c0 commit d279eca

3 files changed

Lines changed: 37 additions & 7 deletions

File tree

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ RESEED_API_KEY=changeme
5757

5858
# Enable immediate onboarding for schools
5959
ENABLE_IMMEDIATE_SCHOOL_ONBOARDING=true
60+
61+
# Salesforce Connect
62+
SALESFORCE_ENABLED=true
63+
SALESFORCE_CONNECT_HOST=salesforce_connect
64+
SALESFORCE_CONNECT_PORT=5432
65+
SALESFORCE_CONNECT_DB=salesforce_development
66+
SALESFORCE_CONNECT_PASSWORD=password
67+
SALESFORCE_CONNECT_USER=postgres

config/database.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,36 @@ default: &default
77
password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
88
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 5) %>
99

10+
salesforce_connect: &salesforce_connect
11+
adapter: postgresql
12+
encoding: unicode
13+
host: <%= ENV.fetch('SALESFORCE_CONNECT_HOST', 'localhost') %>
14+
port: <%= ENV.fetch('SALESFORCE_CONNECT_PORT', '5432') %>
15+
username: <%= ENV.fetch('SALESFORCE_CONNECT_USER', '') %>
16+
password: <%= ENV.fetch('SALESFORCE_CONNECT_PASSWORD', '') %>
17+
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 5) %>
18+
database_tasks: false
19+
1020
development:
11-
<<: *default
12-
database: <%= ENV.fetch('POSTGRES_DB', 'choco_cake_development') %>
21+
default:
22+
<<: *default
23+
database: <%= ENV.fetch('POSTGRES_DB', 'choco_cake_development') %>
24+
salesforce_connect:
25+
<<: *salesforce_connect
26+
database: <%= ENV.fetch('SALESFORCE_CONNECT_DB', 'salesforce_development') %>
1327

1428
test:
15-
<<: *default
16-
database: <%= ENV.fetch('POSTGRES_DB', 'choco_cake_test') %>
29+
default:
30+
<<: *default
31+
database: <%= ENV.fetch('POSTGRES_DB', 'choco_cake_test') %>
32+
salesforce_connect:
33+
<<: *salesforce_connect
34+
database: <%= ENV.fetch('SALESFORCE_CONNECT_DB', 'salesforce_test') %>
1735

1836
production:
19-
<<: *default
20-
url: <%= ENV['DATABASE_URL'] %>
37+
default:
38+
<<: *default
39+
url: <%= ENV['DATABASE_URL'] %>
40+
salesforce_connect:
41+
<<: *salesforce_connect
42+
url: <%= ENV['SALESFORCE_CONNECT_URL'] %>

config/initializers/good_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ def authenticate_admin
1818
# The create_students_job queue is a serial queue that allows only one job at a time.
1919
# DO NOT change the value of create_students_job:1 without understanding the implications
2020
# of processing more than one user creation job at once.
21-
config.good_job.queues = 'create_students_job:1;import_schools_job:1;default:5'
21+
config.good_job.queues = 'create_students_job:1;import_schools_job:1;salesforce_sync:10;default:5'
2222
end

0 commit comments

Comments
 (0)