diff --git a/priv/repo/migrations/20181214201821_add_new_visitor_to_pageviews.exs b/priv/repo/migrations/20181214201821_add_new_visitor_to_pageviews.exs index 1b91b26c5..7adc3eeba 100644 --- a/priv/repo/migrations/20181214201821_add_new_visitor_to_pageviews.exs +++ b/priv/repo/migrations/20181214201821_add_new_visitor_to_pageviews.exs @@ -4,13 +4,7 @@ defmodule Plausible.Repo.Migrations.AddNewVisitorToPageviews do def change do alter table(:pageviews) do - add :new_visitor, :boolean - end - flush() - Plausible.Repo.update_all(Plausible.Pageview, [set: [new_visitor: true]]) - flush() - alter table(:pageviews) do - modify :new_visitor, :boolean, null: false + add :new_visitor, :boolean, null: false end end end diff --git a/priv/repo/migrations/20190117135714_add_uid_to_pageviews.exs b/priv/repo/migrations/20190117135714_add_uid_to_pageviews.exs index 3876b8bc0..89cc3f899 100644 --- a/priv/repo/migrations/20190117135714_add_uid_to_pageviews.exs +++ b/priv/repo/migrations/20190117135714_add_uid_to_pageviews.exs @@ -4,15 +4,7 @@ defmodule Plausible.Repo.Migrations.AddUidToPageviews do def change do alter table(:pageviews) do - add :user_id, :binary_id - end - - flush() - - Repo.update_all(Plausible.Pageview, set: [user_id: "00029281-7f8b-462d-a9f0-0d2ddfc6ea02"]) - - alter table(:pageviews) do - modify :user_id, :string, null: false + add :user_id, :binary_id, null: false end end end diff --git a/priv/repo/migrations/20190520144229_change_user_id_to_uuid.exs b/priv/repo/migrations/20190520144229_change_user_id_to_uuid.exs index 90282aa15..3e12b54c9 100644 --- a/priv/repo/migrations/20190520144229_change_user_id_to_uuid.exs +++ b/priv/repo/migrations/20190520144229_change_user_id_to_uuid.exs @@ -2,9 +2,6 @@ defmodule Plausible.Repo.Migrations.ChangeUserIdToUuid do use Ecto.Migration def change do - execute("DELETE from pageviews where user_id='123'") - execute("UPDATE pageviews set user_id='de610e53-6ec6-4e33-be37-7adcc1bf13be' where user_id='dummy'") - flush() execute("ALTER TABLE pageviews ALTER COLUMN user_id TYPE uuid USING user_id::uuid") end end