build(phoenix): use sqlite instead of postgres
This commit is contained in:
parent
4a0cbeb094
commit
ce8d963331
10 changed files with 31 additions and 31 deletions
|
@ -10,6 +10,8 @@ defmodule LearningPhoenix.Application do
|
|||
children = [
|
||||
LearningPhoenixWeb.Telemetry,
|
||||
LearningPhoenix.Repo,
|
||||
{Ecto.Migrator,
|
||||
repos: Application.fetch_env!(:learning_phoenix, :ecto_repos), skip: skip_migrations?()},
|
||||
{DNSCluster, query: Application.get_env(:learning_phoenix, :dns_cluster_query) || :ignore},
|
||||
{Phoenix.PubSub, name: LearningPhoenix.PubSub},
|
||||
# Start a worker by calling: LearningPhoenix.Worker.start_link(arg)
|
||||
|
@ -31,4 +33,9 @@ defmodule LearningPhoenix.Application do
|
|||
LearningPhoenixWeb.Endpoint.config_change(changed, removed)
|
||||
:ok
|
||||
end
|
||||
|
||||
defp skip_migrations?() do
|
||||
# By default, sqlite migrations are run when using a release
|
||||
System.get_env("RELEASE_NAME") == nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
defmodule LearningPhoenix.Repo do
|
||||
use Ecto.Repo,
|
||||
otp_app: :learning_phoenix,
|
||||
adapter: Ecto.Adapters.Postgres
|
||||
adapter: Ecto.Adapters.SQLite3
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ defmodule LearningPhoenixWeb.Endpoint do
|
|||
@session_options [
|
||||
store: :cookie,
|
||||
key: "_learning_phoenix_key",
|
||||
signing_salt: "RuSasXTJ",
|
||||
signing_salt: "FPy3oQ90",
|
||||
same_site: "Lax"
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue