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

Commit

Permalink
safer database content opt in (#454)
Browse files Browse the repository at this point in the history
* safer database content opt in

the other way doesn't work like i'd hoped with upgrades because the config file is patched from templates and then its confusing why the app isn't working. this is just temporary, soon all apps will use database content anyway, and we won't need this opt in. maybe can drop it for v3 when DB is required.

* linter
  • Loading branch information
redreceipt authored Aug 17, 2021
1 parent 14ac8c6 commit a3b6598
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
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

0 comments on commit a3b6598

Please sign in to comment.