nhost / hasura-auth

Authentication for Hasura.
https://nhost.io
MIT License
386 stars 114 forks source link

chore: migrate `refresh_token` column to `id` #374

Closed szilarddoro closed 1 year ago

szilarddoro commented 1 year ago

Resolves #371

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 6753f1672462f22dbe665acdb994ea9ba65935bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------- | ----- | | hasura-auth | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

wollerman commented 11 months ago

I was looking to upgrade b/c we're pretty far behind and came across this breaking change.

Since this is a breaking change do we need to worry about anything in nhost/metadata/databases/default/tables/auth_refresh_tokens.yml or nhost/metadata/databases/default/tables/auth_users.yml?

Since this is a separate repo it's not clear how it will affect the main hasura metadata. When bumping the version on local I saw:

nhost-api-console-1 | {"detail":{"info":{"objects":[{"definition":{"name":"refresh_tokens","schema":"auth"},"name":"table auth.refresh_tokens in source default","reason":"Inconsistent object: configuration was given for the column \"refresh_token\", but no such column exists","type":"table"},{"definition":{"comment":null,"name":"refreshTokens","source":"default","table":{"name":"users","schema":"auth"},"using":{"foreign_key_constraint_on":{"column":"user_id","table":{"name":"refresh_tokens","schema":"auth"}}}},"name":"array_relation refreshTokens in table auth.users in source default","reason":"Inconsistent object: in table \"auth.users\": in relationship \"refreshTokens\": table \"auth.refresh_tokens\" does not exist in source: default","type":"array_relation"}]},"message":"Inconsistent Metadata!"},"level":"warn","timestamp":"2023-11-30T00:31:09.336+0000","type":"metadata"}

nhost-api-graphql-1 | {"detail":{"info":{"objects":[{"definition":{"name":"refresh_tokens","schema":"auth"},"name":"table auth.refresh_tokens in source default","reason":"Inconsistent object: configuration was given for the column \"refresh_token\", but no such column exists","type":"table"},{"definition":{"comment":null,"name":"refreshTokens","source":"default","table":{"name":"users","schema":"auth"},"using":{"foreign_key_constraint_on":{"column":"user_id","table":{"name":"refresh_tokens","schema":"auth"}}}},"name":"array_relation refreshTokens in table auth.users in source default","reason":"Inconsistent object: in table \"auth.users\": in relationship \"refreshTokens\": table \"auth.refresh_tokens\" does not exist in source: default","type":"array_relation"}]},"message":"Inconsistent Metadata!"},"level":"warn","timestamp":"2023-11-30T00:31:21.551+0000","type":"metadata"}

Let me know if you prefer this on an issue instead; just dropped it here given the release docs pointed to this PR.

Thanks!