subzerocloud / subzero-cli

Tooling to aid development of subZero/PostgREST based backend APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrations are missing roles

toubsen opened this issue · comments

Previous versions of subzero-cli (not sure which) were creating "CREATE ROLE" statements, e.g. for user api.

Current version 0.1.38 is not creating these statements anymore when initializing migrations. Subsequently, adding migrations with diff fails due to missing roles.

Steps to reproduce:
subzero-base-project -d foo -k subzero -m
cd foo
subzero-migrations init
sed -i 's/todo text not null/todo text not null,\nfoo text/g' db/src/data/todo.sql
subzero-migrations add --note "foo" foo

Last command results in the following output:

2019-11-15 16:58:13.549 UTC [75] ERROR:  role "api" does not exist
2019-11-15 16:58:13.549 UTC [75] STATEMENT:  ALTER TABLE api.todos OWNER TO api;
psql:/docker-entrypoint-initdb.d/20191115165501-initial.sql:285: ERROR:  role "api" does not exist
Gave up on waiting for db. The last 30 lines of log are above.

i just fixed this and published version 0.1.39 of the cli (should be available in a few minutes).
Let me know if it works for you

(fixed here ee6d825)

Works fine again now in the newest relase - thanks a lot!