Revert migration

This commit is contained in:
Alexandre de Souza 2025-07-23 18:45:15 -03:00
parent ecfa69788a
commit 86244ce1b3
No known key found for this signature in database
GPG key ID: 29C8CC410E3F1BD0

View file

@ -11,7 +11,6 @@ defmodule Livebook.Migration do
def run() do
insert_personal_hub()
remove_offline_hub()
remove_cli_hub()
storage_version =
case Storage.fetch_key(:system, "global", :migration_version) do
@ -31,7 +30,7 @@ defmodule Livebook.Migration do
Livebook.Hubs.save_hub(%Livebook.Hubs.Personal{
id: Livebook.Hubs.Personal.id(),
hub_name: "Personal",
hub_emoji: "🏠",
hub_emoji: "🝠",
secret_key: Livebook.Hubs.Personal.generate_secret_key()
})
end
@ -47,19 +46,6 @@ defmodule Livebook.Migration do
end
end
@deploy_key_prefix Livebook.Teams.Requests.deploy_key_prefix()
defp remove_cli_hub() do
# The CLI hub will only be present in the storage if the
# user doesn't have the Team hub already persisted with the
# user credentials. Consequently, we always remove it and
# insert on CLI if applicable.
for %{id: "team-" <> _ = id, session_token: @deploy_key_prefix <> _} <- Storage.all(:hubs) do
:ok = Storage.delete(:hubs, id)
end
end
defp migration(1) do
v1_add_personal_hub_secret_key()
v1_delete_local_host_hub()