Migration: add consolidated views feature to enterprise plans
This commit is contained in:
parent
0274f25a9e
commit
05bec55276
|
|
@ -0,0 +1,26 @@
|
|||
defmodule Plausible.Repo.Migrations.AddConsolidatedViewFeatureToEnterprisePlans do
|
||||
use Ecto.Migration
|
||||
|
||||
import Plausible.MigrationUtils
|
||||
|
||||
def up do
|
||||
if enterprise_edition?() do
|
||||
execute """
|
||||
UPDATE enterprise_plans
|
||||
SET features = array_append(features, 'consolidated_view')
|
||||
WHERE features @> ARRAY['revenue_goals', 'props', 'funnels']::varchar[]
|
||||
AND NOT (features @> ARRAY['consolidated_view']::varchar[])
|
||||
"""
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
if enterprise_edition?() do
|
||||
execute """
|
||||
UPDATE enterprise_plans
|
||||
SET features = array_remove(features, 'consolidated_view')
|
||||
WHERE features @> ARRAY['consolidated_view']::varchar[]
|
||||
"""
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue