skip v1 table drop in self-host (#2945)

This commit is contained in:
ruslandoga 2023-05-25 15:32:33 +08:00 committed by GitHub
parent 447ed12155
commit f489d96251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,11 @@ defmodule Plausible.IngestRepo.Migrations.CleanUpOldTablesAfterV2Migration do
use Ecto.Migration
def change do
drop_if_exists table(:events)
drop_if_exists table(:sessions)
selfhost? = Application.fetch_env!(:plausible, :is_selfhost)
unless selfhost? do
drop_if_exists table(:events)
drop_if_exists table(:sessions)
end
end
end