Remove transaction ID

This commit is contained in:
Shadowfacts 2024-04-11 11:55:26 -04:00
parent 819b84caf7
commit 8024e27ebe
3 changed files with 9 additions and 6 deletions

View File

@ -5,7 +5,6 @@ defmodule TuskerPush.Registration do
@type t() :: %__MODULE__{
id: Ecto.UUID.t(),
storekit_original_transaction_id: String.t(),
apns_environment: String.t(),
apns_device_token: String.t(),
push_version: integer(),
@ -16,8 +15,6 @@ defmodule TuskerPush.Registration do
@primary_key {:id, Ecto.UUID, autogenerate: true}
schema "registrations" do
field :storekit_original_transaction_id, :string
field :apns_environment, Ecto.Enum, values: [:production, :development]
# hex-encoded
field :apns_device_token, :string
@ -28,7 +25,6 @@ defmodule TuskerPush.Registration do
end
@create_fields [
:storekit_original_transaction_id,
:apns_environment,
:apns_device_token,
:push_version

View File

@ -6,14 +6,12 @@ defmodule TuskerPushWeb.AppRegistrationsController do
require Logger
def create(conn, %{
"transaction_id" => transaction_id,
"environment" => env,
"device_token" => token,
"push_version" => version
}) do
with {:ok, %Registration{id: id}} <-
TuskerPush.register(%{
storekit_original_transaction_id: transaction_id,
apns_environment: env,
apns_device_token: token,
push_version: version

View File

@ -0,0 +1,9 @@
defmodule TuskerPush.Repo.Migrations.RegistrationsRemoveTransactionId do
use Ecto.Migration
def change do
alter table(:registrations) do
remove :storekit_original_transaction_id
end
end
end