Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

safer database content opt in #454

Merged
merged 2 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apollos-church-api/src/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fs from 'fs';
import path from 'path';
import fetch from 'node-fetch';
import dotenv from "dotenv/config"; // eslint-disable-line
Expand All @@ -8,7 +7,7 @@ ApollosConfig.loadYaml({
configPath: path.join(
__dirname,
'..',
fs.existsSync(path.join(__dirname, '..', 'config.postgres.yml'))
process.env.DATABASE_CONTENT === 'true'
? 'config.postgres.yml'
: 'config.yml'
),
Expand Down
4 changes: 1 addition & 3 deletions apollos-church-api/src/data/index.postgres.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fs from 'fs';
import path from 'path';
import { gql } from 'apollo-server';

import {
Expand Down Expand Up @@ -90,7 +88,7 @@ const data = {
RockPerson, // This entry needs to come before (postgres) Person
BinaryFiles, // This entry needs to come before (postgres) Person
PostgresPerson, // Postgres person for now, as we extend this dataSource in the 'rockWithPostgres' file
...(fs.existsSync(path.join(__dirname, '../..', 'config.postgres.yml'))
...(process.env.DATABASE_CONTENT
? postgresContentModules
: rockContentModules),
Cloudinary,
Expand Down