Skip to content
Snippets Groups Projects
  1. Feb 21, 2020
  2. Feb 19, 2020
  3. Feb 05, 2020
  4. Jan 29, 2020
  5. Jan 28, 2020
  6. Jan 23, 2020
  7. Jan 15, 2020
  8. Jan 08, 2020
  9. Jan 06, 2020
  10. Dec 17, 2019
  11. Dec 02, 2019
  12. Nov 05, 2019
  13. Sep 05, 2019
  14. Aug 25, 2019
  15. Aug 24, 2019
    • Reuben Pereira's avatar
      Drop existing trigger before creating new one · 599cc499
      Reuben Pereira authored
      - When renaming a column concurrently, drop any existing trigger before
      attempting to create a new one.
      
      When running migration specs multiple times (as it happens during
      local development), the down method of previous migrations are called.
      If any of the called methods contains a call to
      rename_column_concurrently, a trigger will be created and not removed.
      So, the next time a migration spec is run, if the same down method is
      executed again, it will cause an error when attempting to create the
      trigger (since it already exists). Dropping the trigger if it already
      exists will prevent this problem.
      599cc499
  16. Jul 26, 2019
  17. Jul 23, 2019
  18. Jul 18, 2019
    • Alexis Kalderimis's avatar
      Improves add_timestamps_with_timezone helper · eda789c3
      Alexis Kalderimis authored and Mayra Cabrera's avatar Mayra Cabrera committed
      This improves the `add_timestamps_with_timezone` helper by allowing the
      column names to be configured. This has the advantage that unnecessary
      columns can be avoided, saving space.
      
      A helper for removing the columns is also provided, to be used in the
      `down` method of migrations.
      eda789c3
  19. Jun 28, 2019
  20. Jun 19, 2019
  21. Jun 17, 2019
  22. Dec 14, 2018
  23. Nov 14, 2018
    • Jan Provaznik's avatar
      Address specs failing in rails 4 · 134edbd7
      Jan Provaznik authored
      We want to run CI with rails 4 for a short-term (until we are sure that
      we will ship with rails 5). The problem is that rails 4 can not handle
      rails 5 schema.rb properly - specifically `t.index` directive can not
      handle multiple indexes on the same column.
      
      Because combination of rails 4 + rails 5 schema will be used
      only in CI for a short-term, we can just ignore these incompatibility
      failures. This patch adds `rails5` helper for specs.
      134edbd7
  24. Aug 11, 2018
  25. Aug 10, 2018
  26. Jun 26, 2018
  27. Mar 28, 2018
  28. Mar 20, 2018
  29. Jan 18, 2018
    • Yorick Peterse's avatar
      Reduce UPDATEs for background column type changes · 0054d383
      Yorick Peterse authored
      Prior to this commit we would essentially update all rows in a table,
      even those where the source column (e.g. `issues.closed_at`) was NULL.
      This in turn could lead to statement timeouts when using the default
      batch size of 10 000 rows per job.
      
      To work around this we don't schedule jobs for rows where the source
      value is NULL. We also don't update rows where the source column is NULL
      (as an extra precaution) or the target column already has a non-NULL
      value. Using this approach it should be possible to update 10 000 rows
      in the "issues" table in about 7.5 - 8 seconds.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
      Unverified
      0054d383
  30. Jan 05, 2018
    • Yorick Peterse's avatar
      Run background migrations with a minimum interval · 7f30bb9c
      Yorick Peterse authored
      This adds a minimum interval to BackgroundMigrationWorker, ensuring
      background migrations of the same class only run once every 5 minutes.
      This prevents a thundering herd problem where scheduled migrations all
      run at once due to their delays having been expired (e.g. as the result
      of a queue being paused for a long time).
      
      If a job was recently executed it's rescheduled with a delay that equals
      the remaining time of the job's lease. This means that if the lease
      expires in two minutes we only need to wait two minutes, instead of
      five.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
      Unverified
      7f30bb9c
  31. Jan 03, 2018
    • Yorick Peterse's avatar
      Use a background migration for issues.closed_at · 78d22fb2
      Yorick Peterse authored
      In a previous attempt (rolled back in
      https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16021) we tried
      to migrate `issues.closed_at` from timestamp to timestamptz using a
      regular migration. This has a bad impact on GitLab.com and as such was
      rolled back.
      
      This commit re-implements the original migrations using generic
      background migrations, allowing us to still migrate the data in a single
      release but without a negative impact on availability.
      
      To ensure the database schema is up to date the background migrations
      are performed inline in development and test environments. We also make
      sure to not migrate that that doesn't need migrating in the first place
      or has already been migrated.
      Unverified
      78d22fb2
  32. Dec 05, 2017
  33. Sep 14, 2017
  34. Aug 29, 2017
    • 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
      Verified
      5eab624d
  35. Aug 22, 2017
  36. Aug 02, 2017
Loading