From b9e6503c14b316725639616eaf630e2ca296f36f Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Wed, 2 Aug 2023 14:38:17 +0700 Subject: [PATCH 1/2] update credential --- lib/formation/postgresql/credential.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/formation/postgresql/credential.ex b/lib/formation/postgresql/credential.ex index f3c3be0..2763e90 100644 --- a/lib/formation/postgresql/credential.ex +++ b/lib/formation/postgresql/credential.ex @@ -17,6 +17,7 @@ defmodule Formation.Postgresql.Credential do embedded_schema do field :host, :string, virtual: true field :resource, :string, virtual: true + field :secure, :string, virtual: true field :port, :integer, default: 5432 field :hostname, :string @@ -31,6 +32,7 @@ defmodule Formation.Postgresql.Credential do |> cast(params, @valid_attrs) |> maybe_set_hostname() |> maybe_set_database() + |> maybe_set_ssl() |> validate_required([:hostname, :port, :username, :database]) end @@ -51,6 +53,14 @@ defmodule Formation.Postgresql.Credential do |> to_string() end + defp maybe_set_ssl(changeset) do + if secure = get_change(changeset, :secure) do + put_change(changeset, :ssl, secure) + else + changeset + end + end + defp maybe_set_database(changeset) do if resource = get_change(changeset, :resource) do put_change(changeset, :database, resource) From 3e0cec50fc62b9793f2d80072f468d48e1e88cbc Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Wed, 2 Aug 2023 14:39:22 +0700 Subject: [PATCH 2/2] update version --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index cb83efa..a8bf2b7 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Formation.MixProject do def project do [ app: :formation, - version: "0.12.2", + version: "0.12.3", elixir: "~> 1.9", start_permanent: Mix.env() == :prod, description: description(),