parent
0f56a13bd8
commit
50e9a9de3f
@ -12,12 +12,14 @@ defmodule ActionRequestsDemo.Release do
|
|||||||
@doc """
|
@doc """
|
||||||
Run the database seeds script inside a release.
|
Run the database seeds script inside a release.
|
||||||
|
|
||||||
Ensures the main application and Faker are started, then evaluates
|
This is designed to be run against a *running* release (e.g. via
|
||||||
the standard `priv/repo/seeds.exs` file.
|
`bin/action_requests_demo eval ...` inside your Docker container),
|
||||||
|
so it does **not** try to start the application or endpoint again.
|
||||||
|
It only ensures Faker is running, then evaluates the standard
|
||||||
|
`priv/repo/seeds.exs` file, which uses `ActionRequestsDemo.Repo`.
|
||||||
"""
|
"""
|
||||||
def seed do
|
def seed do
|
||||||
# Make sure the application (and its supervision tree) is running
|
# Ensure Faker is started in this eval process so Faker.Person.name/0 works
|
||||||
{:ok, _} = Application.ensure_all_started(@app)
|
|
||||||
{:ok, _} = Application.ensure_all_started(:faker)
|
{:ok, _} = Application.ensure_all_started(:faker)
|
||||||
|
|
||||||
seeds_path = Application.app_dir(@app, "priv/repo/seeds.exs")
|
seeds_path = Application.app_dir(@app, "priv/repo/seeds.exs")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user