Remove transaction ID
This commit is contained in:
parent
819b84caf7
commit
8024e27ebe
|
@ -5,7 +5,6 @@ defmodule TuskerPush.Registration do
|
||||||
|
|
||||||
@type t() :: %__MODULE__{
|
@type t() :: %__MODULE__{
|
||||||
id: Ecto.UUID.t(),
|
id: Ecto.UUID.t(),
|
||||||
storekit_original_transaction_id: String.t(),
|
|
||||||
apns_environment: String.t(),
|
apns_environment: String.t(),
|
||||||
apns_device_token: String.t(),
|
apns_device_token: String.t(),
|
||||||
push_version: integer(),
|
push_version: integer(),
|
||||||
|
@ -16,8 +15,6 @@ defmodule TuskerPush.Registration do
|
||||||
@primary_key {:id, Ecto.UUID, autogenerate: true}
|
@primary_key {:id, Ecto.UUID, autogenerate: true}
|
||||||
|
|
||||||
schema "registrations" do
|
schema "registrations" do
|
||||||
field :storekit_original_transaction_id, :string
|
|
||||||
|
|
||||||
field :apns_environment, Ecto.Enum, values: [:production, :development]
|
field :apns_environment, Ecto.Enum, values: [:production, :development]
|
||||||
# hex-encoded
|
# hex-encoded
|
||||||
field :apns_device_token, :string
|
field :apns_device_token, :string
|
||||||
|
@ -28,7 +25,6 @@ defmodule TuskerPush.Registration do
|
||||||
end
|
end
|
||||||
|
|
||||||
@create_fields [
|
@create_fields [
|
||||||
:storekit_original_transaction_id,
|
|
||||||
:apns_environment,
|
:apns_environment,
|
||||||
:apns_device_token,
|
:apns_device_token,
|
||||||
:push_version
|
:push_version
|
||||||
|
|
|
@ -6,14 +6,12 @@ defmodule TuskerPushWeb.AppRegistrationsController do
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
def create(conn, %{
|
def create(conn, %{
|
||||||
"transaction_id" => transaction_id,
|
|
||||||
"environment" => env,
|
"environment" => env,
|
||||||
"device_token" => token,
|
"device_token" => token,
|
||||||
"push_version" => version
|
"push_version" => version
|
||||||
}) do
|
}) do
|
||||||
with {:ok, %Registration{id: id}} <-
|
with {:ok, %Registration{id: id}} <-
|
||||||
TuskerPush.register(%{
|
TuskerPush.register(%{
|
||||||
storekit_original_transaction_id: transaction_id,
|
|
||||||
apns_environment: env,
|
apns_environment: env,
|
||||||
apns_device_token: token,
|
apns_device_token: token,
|
||||||
push_version: version
|
push_version: version
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue