chronomodel icon indicating copy to clipboard operation
chronomodel copied to clipboard

Document how to set up database permissions for schemas "history" and "temporal"

Open roschaefer opened this issue 6 years ago • 0 comments

OK, just now I figured out the solution to my problem: Insufficient database permissions for the user on production. I had to

grant usage on schema history to "my_database_user";
grant usage on schema temporal to "my_database_user";

grant all privileges on all tables in schema history to "my_database_user";
grant all privileges on all sequences in schema history to "my_database_user";

grant all privileges on all tables in schema temporal to "my_database_user";
grant all privileges on all sequences in schema temporal to "my_database_user";

This is what I got after merging chronomodel into master and running migrations on our production server:

  def set_impression
    @impression = Impression.find(params[:id])
  end

leads to

ActiveRecord::UnknownPrimaryKey (Unknown primary key for table impressions in model Impression.):

and Impression.primary_key is nil. Even if the migrations have run successfully, when I ask Impression.chrono? I get false.

This was all not very self-explaining and it took me a while until I found out the source of the problem.

So my suggestion is to either:

  1. Add a hint in the README
  2. Check for permissions and raise a more helpful error

Thoughts?

roschaefer avatar Nov 21 '17 14:11 roschaefer