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'm using hair-trigger with a multi-tenant application that uses Postgres schemas to separate each tenant's information. Doing schema_load on a newly created tenant errors out, because on the schema.rb the CREATE FUNCTION script has the public schema hardcoded, ex:
# no candidate create_trigger statement could be found, creating an adapter-specific one
execute(<<-TRIGGERSQL)
CREATE OR REPLACEFUNCTIONpublic.tsv_body_trigger()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGINNEW.tsv_body := to_tsvector('pg_catalog.spanish', coalesce(NEW.content,''));
RETURN NULL;
END;
$function$
TRIGGERSQL
This causes that the SQL that creates the trigger errors out because the function is not defined in the schema:
# no candidate create_trigger statement could be found, creating an adapter-specific oneexecute("CREATE TRIGGER tsv_body_trigger AFTER INSERT OR UPDATE ON \"pg_search_documents\" FOR EACH ROW EXECUTE PROCEDURE tsv_body_trigger()")
The text was updated successfully, but these errors were encountered:
Also, I'm diving into the code to see if I can pinpoint the problem, but when trying to run the tests for the gem, I get these errors: error creating database: createdb: could not connect to database template1: FATAL: role "hairtrigger" does not exist.
I'd recommend adding a contributing part to the readme, to avoid these types of issues and maybe opening a gitter room, so that people can talk over there, and ask help.
Ooof, sorry for the radio silence :( ... I'm not using hairtrigger in any of my projects anymore, so I don't spend a whole lot of time on it these days. That said, I'd be open to reviewing a PR to address this 👍
I'll see about tweaking either documenting the spec db setup, or tweaking how it works so it just authenticates as USER (probably ok for most setups).
I'm using hair-trigger with a multi-tenant application that uses Postgres schemas to separate each tenant's information. Doing schema_load on a newly created tenant errors out, because on the schema.rb the CREATE FUNCTION script has the public schema hardcoded, ex:
This causes that the SQL that creates the trigger errors out because the function is not defined in the schema:
The text was updated successfully, but these errors were encountered: