Adds indices to support joins with foreign keys, and to support queries we have seen in production.
Known issues
Some tables may contain so few records that the PG query planner will not actually use the indices, but at least they will be in place for future.
Adding the constraint changesets_users_id_fk into changesets is going to cause problems: Executing this on a development db, I got an error because some user_ids are not present in the user table:
This PR modifies the PG database schema.
Known issues
changesets_users_id_fk
intochangesets
is going to cause problems: Executing this on a development db, I got an error because some user_ids are not present in the user table:The missing users issue should be resolved before changing the table create statement here.
Please beware because I have not done any integration testing and do not really have any way to see what side effects it will cause. 😄
@CloudNiner I marked this as a Draft PR, because of the user_id concern.