2019-03-05 11:09:15 -07:00
|
|
|
defmodule FarmbotCore.Config.Repo.Migrations.AddBetaState do
|
2018-04-16 11:23:28 -06:00
|
|
|
use Ecto.Migration
|
2019-03-05 11:09:15 -07:00
|
|
|
import FarmbotCore.Config.MigrationHelpers
|
2018-05-10 17:37:17 -06:00
|
|
|
|
2020-01-17 08:58:53 -07:00
|
|
|
@default_currently_on_beta Application.get_env(
|
|
|
|
:farmbot_core,
|
|
|
|
FarmbotCore.EctoMigrator
|
|
|
|
)[:default_currently_on_beta]
|
2018-11-30 13:40:57 -07:00
|
|
|
|
2018-10-29 16:27:01 -06:00
|
|
|
if is_nil(@default_currently_on_beta),
|
2020-01-17 08:58:53 -07:00
|
|
|
do:
|
|
|
|
Mix.raise("Missing application env config: `:default_currently_on_beta`")
|
2018-04-16 11:23:28 -06:00
|
|
|
|
|
|
|
def change do
|
2020-01-17 08:58:53 -07:00
|
|
|
create_settings_config(
|
|
|
|
"currently_on_beta",
|
|
|
|
:bool,
|
|
|
|
@default_currently_on_beta
|
|
|
|
)
|
2018-04-16 11:23:28 -06:00
|
|
|
end
|
|
|
|
end
|