Migrations for #3641 (#3644)

* Migrations for #3641

* Fix typo
This commit is contained in:
hq1 2023-12-20 15:40:39 +01:00 committed by GitHub
parent 222de719ea
commit 1678fa10f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,12 @@
defmodule Plausible.Repo.Migrations.TrackAcceptTrafficUntilNotifcations do
use Ecto.Migration
def change do
create table(:sent_accept_traffic_until_notifications) do
add :user_id, references(:users, on_delete: :delete_all), null: false
add :sent_on, :date, null: false
end
create unique_index(:sent_accept_traffic_until_notifications, [:user_id, :sent_on])
end
end

View File

@ -0,0 +1,10 @@
defmodule Plausible.Repo.Migrations.AddAcceptTrafficUntilToUser do
use Ecto.Migration
def change do
# deleting accept_traffic_until from sites table will come later, not to crash anything live right now
alter table(:users) do
add :accept_traffic_until, :date
end
end
end