1. 12 Jul, 2019 1 commit
  2. 07 Nov, 2018 1 commit
    • gfyoung's avatar
      Enable even more frozen string in lib/gitlab · 70459264f202
      gfyoung authored
      Enables frozens string for the following:
      * lib/gitlab/conflict/**/*.rb
      * lib/gitlab/cross_project_access/**/*.rb
      * lib/gitlab/cycle_analytics/**/*.rb
      * lib/gitlab/data_builder/**/*.rb
      * lib/gitlab/database/**/*.rb
      * lib/gitlab/dependency_linker/**/*.rb
      * lib/gitlab/diff/**/*.rb
      * lib/gitlab/downtime_check/**/*.rb
      * lib/gitlab/email/**/*.rb
      * lib/gitlab/etag_caching/**/*.rb
      Partially addresses gitlab-org/gitlab-ce#47424.
  3. 17 Sep, 2018 1 commit
    • Yorick Peterse's avatar
      Added FromUnion to easily select from a UNION · 84f6b869d148
      Yorick Peterse authored
      This commit adds the module `FromUnion`, which provides the class method
      `from_union`. This simplifies the process of selecting data from the
      result of a UNION, and reduces the likelihood of making mistakes. As a
      result, instead of this:
          union = Gitlab::SQL::Union.new([foo, bar])
          Foo.from("(#{union.to_sql}) #{Foo.table_name}")
      We can now write this instead:
          Foo.from_union([foo, bar])
      This commit also includes some changes to make this new setup work
      properly. For example, a bug in Rails 4
      (https://github.com/rails/rails/issues/24193) would break the use of
      `from("sub-query-here").includes(:relation)` in certain cases. There was
      also a CI query which appeared to repeat a lot of conditions from an
      outer query on an inner query, which isn't necessary.
      Finally, we include a RuboCop cop to ensure developers use this new
      module, instead of using Gitlab::SQL::Union directly.
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
  4. 22 Jan, 2018 1 commit
  5. 06 Nov, 2017 1 commit
  6. 29 Aug, 2017 1 commit
    • Yorick Peterse's avatar
      Improve migrations using triggers · 646287757b26
      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
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633