nhost / hasura-auth

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

Migration error when running with Docker: Syntax error at or near "(" #361

Closed angelorc closed 5 months ago

angelorc commented 1 year ago

Hello there,

I've encountered an issue when trying to run hasura-auth using Docker. I'm receiving the following error message:

Error: Migration failed. Reason: An error occurred running 'add_refresh_token_hash_column'. Rolled back this migration. No further migrations were run. Reason: syntax error at or near "("

It appears that there might be a problem with the latest migration:

BEGIN;
ALTER TABLE "auth"."refresh_tokens"
    ADD COLUMN "refresh_token_hash" VARCHAR(255) GENERATED ALWAYS AS (sha256 (refresh_token::text::bytea)) STORED;
COMMENT ON COLUMN "auth"."refresh_tokens"."refresh_token" IS 'DEPRECATED: auto-generated refresh token id. Will be replaced by a genereric id column that will be used as a primary key, not the refresh token itself. Use refresh_token_hash instead.';
COMMIT;

The docker-compose file I am using is docker-compose-example.yaml.

Would you be able to help me resolve this issue, or provide any guidance on how to proceed? Your assistance would be greatly appreciated.

Thank you in advance for your time and support.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dbarrosop commented 11 months ago

Apologies, this one fell through the cracks... If you are still having the issue I bet it is related to the postgres version. Check which version you have, migrations should work fine with postgres 14.6 onwards.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.