• Yorick Peterse's avatar
    Improve migrations using triggers · 5eab624d
    Yorick Peterse authored
    This adds a bunch of checks to migrations that may create or drop
    triggers. Dropping triggers/functions is done using "IF EXISTS" so we
    don't throw an error if the object in question has already been dropped.
    We now also raise a custom error (message) when the user does not have
    TRIGGER privileges. This should prevent the schema from entering an
    inconsistent state while also providing the user with enough information
    on how to solve the problem.
    
    The recommendation of using SUPERUSER permissions is a bit extreme but
    we require this anyway (Omnibus also configures users with this
    permission).
    
    Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
    5eab624d
grant_spec.rb 1 KB