Hello guys. I am getting the following error for s...
# support-questions-legacy
v
Hello guys. I am getting the following error for some of recipe endpoint:
Copy code
ERROR: relation "userid_mapping" does not exist
Any idea why?
n
Hi @vladmit Can you share some code for how you are using it?
r
Which version of the core are you using?
v
Copy code
thirdPartySignInUp: async function (input) {
              // TODO: some custom logic
              // or call the default behaviour as show below
              try {
                const created = await originalImplementation.thirdPartySignInUp(input);

                console.log({ created });
                if (created.status === 'OK') {
                  const user = await prisma.thirdparty_users.findFirst({
                    where: {
                      third_party_user_id: input.thirdPartyUserId,
                      third_party_id: input.thirdPartyId,
                    },
                  });
                  if (user) {
                    const balance = await prisma.user_balance.findUnique({
                      where: {
                        user_id: user.user_id,
                      },
                    });
                    if (!balance)
                      await prisma.user_balance.create({
                        data: {
                          user_id: user.user_id,
                          amount: 0,
                        },
                      });
                  }
                }
                return created;
              } catch (e) {
                console.warn(e);
              }
            },
This is an example of me using a recipe that throws that error
as for version, I think it is the latest? I am using the docker image
r
What’s the docker image tag?
v
it might be that a recent update changed the internal schema and prisma messes it up? Tag is
registry.supertokens.io/supertokens/supertokens-postgresql
r
Yea I think so.
We added a new table in the newer core versions called userid_mapping. But the core should have created that table on its own on start
v
I think it's my fault then. I am using a prisma schema which was generated based on an older version of supertokens core and now im still aplying it.
r
Ah right. Well, you can find the latest schema in our docs
v
Where can I see the releases for that image? I'm thinking of setting the exact version so it doesnt happen in the future with updates and maybe I'll manually upgrade later
v
thank you!
10 Views