-
Hi, first of all thank you very much for your work on this! I tried this with fresh Phoenix 1.6.16 and 1.7.3: after following the install instructions and setting everything up (with mix shopifex.install), during Shop install I get this error message:
And sure enough, that table is empty. I was wondering if there is another step I have to do before I try to install the plugin to a store? To populate the table I mean. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hi @stiegi ! Sorry about that! I think the For example, these changes were needed for Before:defmodule ShopifexTest.ShopifyShops.ShopifyShop do
use Ecto.Schema
import Ecto.Changeset
schema "shopify_shops" do
has_many :grants, ShopifexTest.ShopifyShops.ShopifyGrant, foreign_key: :shop_id
timestamps()
end
@doc false
def changeset(shopify_shop, attrs) do
shopify_shop
|> cast(attrs, [:url, :access_token, :scope])
|> validate_required( [:url, :access_token, :scope])
end
end After:defmodule ShopifexTest.ShopifyShops.ShopifyShop do
use Ecto.Schema
import Ecto.Changeset
schema "shopify_shops" do
field :url, :string
field :access_token, :string
field :scope, :string
has_many :grants, ShopifexTest.ShopifyShops.ShopifyGrant, foreign_key: :shop_id
timestamps()
end
@doc false
def changeset(shopify_shop, attrs) do
shopify_shop
|> cast(attrs, [:url, :access_token, :scope])
|> validate_required( [:url, :access_token, :scope])
end
end You can determine which fields are missing from each schema based on the changeset's I haven't had time to fix this, but it would be a great opportunity for someone to contribute to the library :) |
Beta Was this translation helpful? Give feedback.
hi @stiegi !
Sorry about that! I think the
mix shopifex.install
no longer injects the fields into the schemas properly any more, so you need to manually update the following files and input their field names:shopify_shop.ex
,shopify_grant.ex
,shopify_plan.ex
.For example, these changes were needed for
shopify_shop.ex
:Before: