parent
19f14f7046
commit
2e61ee0031
14 changed files with 73 additions and 134 deletions
@ -1,44 +0,0 @@ |
||||
# In this file, we load production configuration and secrets |
||||
# from environment variables. You can also hardcode secrets, |
||||
# although such is generally not recommended and you have to |
||||
# remember to add this file to your .gitignore. |
||||
use Mix.Config |
||||
|
||||
database_url = |
||||
System.get_env("DATABASE_URL") || |
||||
raise """ |
||||
environment variable DATABASE_URL is missing. |
||||
For example: ecto://USER:PASS@HOST/DATABASE |
||||
""" |
||||
|
||||
config :bones73k, Bones73k.Repo, |
||||
# ssl: true, |
||||
url: database_url, |
||||
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10") |
||||
|
||||
secret_key_base = |
||||
System.get_env("SECRET_KEY_BASE") || |
||||
raise """ |
||||
environment variable SECRET_KEY_BASE is missing. |
||||
You can generate one by calling: mix phx.gen.secret |
||||
""" |
||||
|
||||
config :bones73k, Bones73kWeb.Endpoint, |
||||
http: [ |
||||
port: String.to_integer(System.get_env("PORT") || "4000"), |
||||
transport_options: [socket_opts: [:inet6]] |
||||
], |
||||
secret_key_base: secret_key_base |
||||
|
||||
# ## Using releases (Elixir v1.9+) |
||||
# |
||||
# If you are doing OTP releases, you need to instruct Phoenix |
||||
# to start each relevant endpoint: |
||||
# |
||||
# config :bones73k, Bones73kWeb.Endpoint, server: true |
||||
# |
||||
# Then you can assemble a release by calling `mix release`. |
||||
# See `mix help release` for more information. |
||||
|
||||
# Import extra secret stuff not to be included in git repo |
||||
import_config "really.secret.exs" |
@ -1,10 +0,0 @@ |
||||
defmodule Bones73k.Util.Dt do |
||||
@app_vars Application.get_env(:bones73k, :app_global_vars, time_zone: "America/New_York") |
||||
@time_zone @app_vars[:time_zone] |
||||
|
||||
def ndt_to_local(%NaiveDateTime{} = ndt), do: Timex.to_datetime(ndt, @time_zone) |
||||
|
||||
def format_dt_local(dt_local, fstr), do: Timex.format!(dt_local, fstr) |
||||
|
||||
def format_ndt(%NaiveDateTime{} = ndt, fstr), do: ndt |> ndt_to_local() |> format_dt_local(fstr) |
||||
end |
@ -1,21 +0,0 @@ |
||||
defmodule Bones73k.Repo.Migrations.AddRoleToUsers do |
||||
use Ecto.Migration |
||||
|
||||
alias Bones73k.Accounts.User.RolesEnum |
||||
|
||||
def up do |
||||
RolesEnum.create_type() |
||||
|
||||
alter table(:users) do |
||||
add(:role, RolesEnum.type(), null: false) |
||||
end |
||||
end |
||||
|
||||
def down do |
||||
alter table(:users) do |
||||
remove(:role) |
||||
end |
||||
|
||||
RolesEnum.drop_type() |
||||
end |
||||
end |
Loading…
Reference in new issue