You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Postgres and 2 users in it (user1 and user2) with all granted rights. I run migrations as user1 and it completed successfully, then I try to run the same migrations from user2, but I get error relation "goose_db_version" already exists, although the real error is that permission to read "goose_db_version" table is denied for user2.
The problem is in the line https://github.com/pressly/goose/blob/master/migrate.go#L216, goose tries to get list of migrations and after getting any error tries to create table "goose_db_version". This is confusing, I think it is necessary to create table "goose_db_version" only if it does not exist and return error in any other case.
The text was updated successfully, but these errors were encountered:
I use goose as a library in my go app. It doesn't really matter whether you perform migrations sequentially or in parallel: the user who created "goose_db_version" table will have access to it, but others will not. If I grant permissions to other users to read "goose_db_version" table, the error is gone.
The problem is that goose doesn't return a real error as I pointed out in the post above, and that's misleading.
I have Postgres and 2 users in it (user1 and user2) with all granted rights. I run migrations as user1 and it completed successfully, then I try to run the same migrations from user2, but I get error
relation "goose_db_version" already exists
, although the real error is that permission to read "goose_db_version" table is denied for user2.The problem is in the line https://github.com/pressly/goose/blob/master/migrate.go#L216, goose tries to get list of migrations and after getting any error tries to create table "goose_db_version". This is confusing, I think it is necessary to create table "goose_db_version" only if it does not exist and return error in any other case.
The text was updated successfully, but these errors were encountered: