diff --git a/priv/repo/migrations/20231204151831_backfill_last_bill_date_to_subscriptions.exs b/priv/repo/migrations/20231204151831_backfill_last_bill_date_to_subscriptions.exs new file mode 100644 index 000000000..13dcd7b13 --- /dev/null +++ b/priv/repo/migrations/20231204151831_backfill_last_bill_date_to_subscriptions.exs @@ -0,0 +1,11 @@ +defmodule Plausible.Repo.Migrations.BackfillLastBillDateToSubscriptions do + use Ecto.Migration + + def change do + execute """ + UPDATE subscriptions + SET last_bill_date = inserted_at::date + WHERE last_bill_date IS NULL AND paddle_plan_id != 'free_10k'; + """ + end +end