Remove historical migrations that stop test database from being created

This commit is contained in:
Uku Taht 2019-10-25 14:34:54 +08:00
parent c5704c4e09
commit edca2a57df
3 changed files with 2 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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