Force farmware to be reinstalled.

This has to be done because v8 was shipped with a configuration error causing
farmware to install to the temporary data partition on the raspberry pi.
feature/sequence-on-boot
Connor Rigby 2019-11-18 14:32:55 -08:00
parent bd51878b41
commit 3886304c54
No known key found for this signature in database
GPG Key ID: 29A88B24B70456E0
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
defmodule FarmbotCore.Asset.Repo.Migrations.ForceReinstallFarmware do
use Ecto.Migration
alias FarmbotCore.Asset.{
Repo,
FirstPartyFarmware,
FarmwareInstallation
}
# this migration is here because v8 was shipped with a configuration error
# causing farmware to install to the temporary data partition on the
# raspberry pi.
def change do
for %{manifest: %{}} = fwi <- Repo.all(FirstPartyFarmware),
do: Repo.update!(FirstPartyFarmware.changeset(fwi, %{manifest: nil}))
for %{manifest: %{}} = fwi <- Repo.all(FarmwareInstallation),
do: Repo.update!(FarmwareInstallation.changeset(fwi, %{manifest: nil}))
end
end