User lacks privileges during migrations

Hi @Roachers,
I’ve been working on trying to automate migrations with flyway. All sql statements have been working until i tried to add a new column using the flyway migration with a user granted all the privileges. Error message.

ERROR: Migration of schema "auth_service" to version 0.0.4 - alter user add account [non-transactional] failed! Please restore backups and roll back database and code!
Migration V0.0.4__alter_user_add_account.sql failed
SQL State  : XX000
Error Code : 0
Message    : ERROR: user flyway does not have CREATE privilege on relation users
Location   : ./sql/auth_service/V0.0.4__alter_user_add_account.sql (/home/kingori/flyway/./sql/auth_service/V0.0.4__alter_user_add_account.sql)
Line       : 1
Statement  : ALTER TABLE users ADD COLUMN account_no STRING

If i run the same sql statement as root it works.

Could this be as a result of using the open source version?

Thanks in advance.

Moses King’ori

Hi @kingmoses,

Sorry for the delay in response. When you granted the user flyway all privileges, did you use this statement:
GRANT ALL ON DATABASE x TO flyway as described here?