mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
20 lines
459 B
Elixir
20 lines
459 B
Elixir
defmodule Plausible.Repo.Migrations.AddPropertyToGoogleAuth do
|
|
use Ecto.Migration
|
|
use Plausible.Repo
|
|
|
|
def change do
|
|
alter table(:google_auth) do
|
|
add :property, :text
|
|
end
|
|
|
|
flush()
|
|
|
|
for auth <- Repo.all(Plausible.Site.GoogleAuth) do
|
|
auth = Repo.preload(auth, :site)
|
|
property = "https://#{auth.site.domain}"
|
|
Plausible.Site.GoogleAuth.set_property(auth, %{property: property})
|
|
|> Repo.update!
|
|
end
|
|
end
|
|
end
|