Make use of the read-only repo config for prod env (#3)

This commit is contained in:
Alexey 2020-04-29 14:50:00 +03:00 committed by GitHub
parent 526ad6edda
commit 0656732149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,9 @@ import Config
# Development compile-time app env
config :pathfinder,
read_only: :false
config :pathfinder, Woody.Server,
ip: "0.0.0.0",
port: 8022

View File

@ -1,5 +1,8 @@
defmodule NewWay.Repo do
@read_only Application.compile_env(:pathfinder, :read_only, :true)
use Ecto.Repo,
otp_app: :pathfinder,
adapter: Ecto.Adapters.Postgres
adapter: Ecto.Adapters.Postgres,
read_only: @read_only
end

View File

@ -2,7 +2,7 @@ defmodule NewWay.Repo.Migrations.Schema do
use Ecto.Migration
def up do
execute "CREATE SCHEMA nw"
execute "CREATE SCHEMA IF NOT EXISTS nw"
end
def down do