Add Push notifications backend support
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.AddGroupNotificationAndLastNotificationDateSettings do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:user_settings) do
|
||||
add(:group_notifications, :integer, default: 10, nullable: false)
|
||||
add(:last_notification_sent, :utc_datetime, nullable: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
defmodule Mobilizon.Repo.Migrations.CreateUserPushSubscriptions do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:user_push_subscriptions, primary_key: false) do
|
||||
add(:id, :uuid, primary_key: true)
|
||||
add(:user_id, references(:users, on_delete: :nothing), null: false)
|
||||
add(:digest, :text, null: false)
|
||||
add(:data, :map, null: false)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create(unique_index(:user_push_subscriptions, [:user_id, :digest]))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user