upgrade from mix.config to config

This commit is contained in:
byte[] 2019-12-04 10:35:16 -05:00
parent 748086c01f
commit ce4b1b1bcf
7 changed files with 11 additions and 9 deletions

View file

@ -1,11 +1,11 @@
# This file is responsible for configuring your application # This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module. # and its dependencies with the aid of the Config module.
# #
# This configuration file is loaded before any dependency and # This configuration file is loaded before any dependency and
# is restricted to this project. # is restricted to this project.
# General application configuration # General application configuration
use Mix.Config import Config
config :philomena, config :philomena,
ecto_repos: [Philomena.Repo], ecto_repos: [Philomena.Repo],

View file

@ -1,4 +1,4 @@
use Mix.Config import Config
# Configure your database # Configure your database
config :philomena, Philomena.Repo, config :philomena, Philomena.Repo,

View file

@ -1,4 +1,4 @@
use Mix.Config import Config
# For production, don't forget to configure the url host # For production, don't forget to configure the url host
# to something meaningful, Phoenix uses this information # to something meaningful, Phoenix uses this information

View file

@ -2,7 +2,7 @@
# from environment variables. You can also hardcode secrets, # from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to # although such is generally not recommended and you have to
# remember to add this file to your .gitignore. # remember to add this file to your .gitignore.
use Mix.Config import Config
database_url = database_url =
System.get_env("DATABASE_URL") || System.get_env("DATABASE_URL") ||

View file

@ -1,4 +1,4 @@
use Mix.Config import Config
# Configure your database # Configure your database
config :philomena, Philomena.Repo, config :philomena, Philomena.Repo,

View file

@ -25,7 +25,9 @@ defmodule Philomena.Commissions.Commission do
@doc false @doc false
def changeset(commission, attrs) do def changeset(commission, attrs) do
commission commission
|> cast(attrs, []) |> cast(attrs, [:information, :contact, :will_create, :will_not_create, :open, :sheet_image_id, :categories])
|> validate_required([]) |> validate_required([:user, :information, :contact, :open])
|> validate_length(:information, max: 700, count: :bytes)
|> validate_length(:contact, max: 700, count: :bytes)
end end
end end

View file

@ -15,7 +15,7 @@ alias Philomena.Tags
import Ecto.Query import Ecto.Query
IO.puts "---- Creating Elasticsearch indices" IO.puts "---- Creating Elasticsearch indices"
for model <- [Image, Comment, Gallery, Tag, Post, Report] do # Report for model <- [Image, Comment, Gallery, Tag, Post, Report] do
model.delete_index! model.delete_index!
model.create_index! model.create_index!
end end