defmodule NotificationDispatcher.Migration do use Ecto.Migration def create_notification_messages() do create table(:notification_messages, primary_key: false) do add :id, :uuid, primary_key: true add :title, :string add :message, :text add :notification_type, :integer add :channel, :integer add :locale, :string add :dispatch_offsets, :text timestamps() end create index(:notification_messages, [:locale]) create index(:notification_messages, [:channel]) create index(:notification_messages, [:notification_type]) end def create_devices() do create table(:devices, primary_key: false) do add :id, :uuid, primary_key: true add :user_id, :uuid, null: false add :device_token, :text, null: false add :os, :integer timestamps() end create index(:devices, :user_id) create unique_index(:devices, :device_token) create index(:devices, :os) end end