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
-- Set up realtime
create schema if not exists realtime;
-- create publication xyz_realtime; -- defaults to empty publication
create publication xyz_realtime;
-- super admin
create user xyz;
Note:
I had run tusker diff previously and it failed which presumably created the role which tusker clean doesn't remove
I have tried setting privileges = false and privileges = true in tusker.toml with the same results
The text was updated successfully, but these errors were encountered:
Users and roles are database global and not part of the schema.
Therefore they can't be part of a migration and cause all sorts of troubles.
There is virtually nothing we can do about this as this and the best solution I came up for is having a separate create-roles.sql file which creates all the needed roles (and users) for me.
Since there is no CREATE USER ... IF NOT EXISTS you can use the following workaround:
DO $do$
BEGIN
IF NOT EXISTS (
SELECTFROMpg_catalog.pg_userWHERE usename ='xyz')
THEN
CREATEUSERxyz;
END IF;
END
$do$;
If you do find a better way to manage users and roles please let me know.
Steps to reproduce:
Version
00-initial-schema.sql
Note:
tusker diff
previously and it failed which presumably created the role whichtusker clean
doesn't removeprivileges = false
andprivileges = true
intusker.toml
with the same resultsThe text was updated successfully, but these errors were encountered: