Commit Graph

117 Commits

Author SHA1 Message Date
GitLab Bot b58ab6c33c Add latest changes from gitlab-org/gitlab@master 2020-10-16 18:09:04 +00:00
GitLab Bot 6035fcc36e Add latest changes from gitlab-org/gitlab@master 2020-10-14 09:08:46 +00:00
GitLab Bot a7cacc8293 Add latest changes from gitlab-org/gitlab@master 2020-10-06 06:08:38 +00:00
GitLab Bot ec18750aa8 Add latest changes from gitlab-org/gitlab@master 2020-10-05 18:08:51 +00:00
GitLab Bot 6aa5c04c74 Add latest changes from gitlab-org/gitlab@master 2020-09-30 12:09:53 +00:00
GitLab Bot dce5758796 Add latest changes from gitlab-org/gitlab@master 2020-09-28 18:09:40 +00:00
GitLab Bot 86fa823611 Add latest changes from gitlab-org/gitlab@master 2020-09-23 06:09:45 +00:00
GitLab Bot 9689350c65 Add latest changes from gitlab-org/gitlab@master 2020-09-14 21:09:27 +00:00
GitLab Bot 49a897eff9 Add latest changes from gitlab-org/gitlab@master 2020-09-08 09:08:31 +00:00
GitLab Bot b355535770 Add latest changes from gitlab-org/gitlab@master 2020-09-04 18:08:48 +00:00
GitLab Bot 71da5de44f Add latest changes from gitlab-org/gitlab@master 2020-08-05 15:09:59 +00:00
GitLab Bot 3261f18a4b Add latest changes from gitlab-org/gitlab@master 2020-07-24 03:09:19 +00:00
GitLab Bot b0da29fca9 Add latest changes from gitlab-org/gitlab@master 2020-07-16 00:09:17 +00:00
GitLab Bot ce06ce825b Add latest changes from gitlab-org/gitlab@master 2020-07-06 15:08:42 +00:00
GitLab Bot 082b24b03b Add latest changes from gitlab-org/gitlab@master 2020-06-24 00:08:43 +00:00
GitLab Bot ea054ec1c3 Add latest changes from gitlab-org/gitlab@master 2020-06-09 12:08:55 +00:00
GitLab Bot c4c1fc5fe7 Add latest changes from gitlab-org/gitlab@master 2020-05-15 15:08:04 +00:00
GitLab Bot e689e858ed Add latest changes from gitlab-org/gitlab@master 2020-05-13 18:08:47 +00:00
GitLab Bot ae69a88c2a Add latest changes from gitlab-org/gitlab@master 2020-05-08 03:09:54 +00:00
GitLab Bot 56df7f06f1 Add latest changes from gitlab-org/gitlab@master 2020-04-28 00:09:33 +00:00
GitLab Bot 45999bfdec Add latest changes from gitlab-org/gitlab@master 2020-04-27 12:09:41 +00:00
GitLab Bot db061f4432 Add latest changes from gitlab-org/gitlab@master 2020-04-22 18:09:52 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
GitLab Bot 602ea42669 Add latest changes from gitlab-org/gitlab@master 2020-04-13 21:09:38 +00:00
GitLab Bot e80e0dd64f Add latest changes from gitlab-org/gitlab@master 2020-03-26 15:08:16 +00:00
GitLab Bot c4db541c1b Add latest changes from gitlab-org/gitlab@master 2020-03-24 21:07:54 +00:00
GitLab Bot 42263d6451 Add latest changes from gitlab-org/gitlab@master 2020-03-02 00:07:41 +00:00
GitLab Bot a6c2be7cd2 Add latest changes from gitlab-org/gitlab@master 2020-02-21 21:08:57 +00:00
GitLab Bot a53d2c37c4 Add latest changes from gitlab-org/gitlab@master 2020-02-21 09:09:01 +00:00
GitLab Bot 33795139ea Add latest changes from gitlab-org/gitlab@master 2020-02-19 18:09:10 +00:00
GitLab Bot 6b9d3a4e83 Add latest changes from gitlab-org/gitlab@master 2020-01-29 18:08:47 +00:00
GitLab Bot 6315ed9630 Add latest changes from gitlab-org/gitlab@master 2020-01-28 18:08:35 +00:00
GitLab Bot d65442b1d9 Add latest changes from gitlab-org/gitlab@master 2020-01-23 00:08:53 +00:00
GitLab Bot a7df1d8717 Add latest changes from gitlab-org/gitlab@master 2020-01-08 15:08:01 +00:00
GitLab Bot 015663b70f Add latest changes from gitlab-org/gitlab@master 2020-01-06 21:07:43 +00:00
GitLab Bot badb9c1dea Add latest changes from gitlab-org/gitlab@master 2019-12-17 12:08:11 +00:00
GitLab Bot bffcdf9bca Add latest changes from gitlab-org/gitlab@master 2019-12-02 12:06:45 +00:00
GitLab Bot 69944ffb68 Add latest changes from gitlab-org/gitlab@master 2019-11-12 15:06:26 +00:00
GitLab Bot 4c464055fb Add latest changes from gitlab-org/gitlab@master 2019-11-05 15:06:17 +00:00
GitLab Bot 0a850868df Add latest changes from gitlab-org/gitlab@master 2019-10-09 12:06:13 +00:00
Reuben Pereira 43d33ef824 Refactor new undo_* methods
- Move code for creating a new column from old into a function so that
it can be reused.
- Also add comments above the methods.
2019-09-05 12:15:16 +00:00
Reuben Pereira f855f9b815 Add helper to exactly undo cleanup_concurrent_column_rename
- Also add helper to undo rename_column_concurrently.
2019-08-25 20:14:52 +00:00
Reuben Pereira 599cc49973 Drop existing trigger before creating new one
- 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.
2019-08-24 04:20:29 +00:00
Andreas Brandl 988dc80585
Further remove code branches by database type
We dropped MySQL support and a lot of mysql specific code has been
removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608.

This comes in from the other direction and removes any `if postgresql?`
branches.
2019-07-29 12:47:06 +02:00
Nick Thomas 4aa76dddec
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
2019-07-23 16:53:03 +01:00
Alex Kalderimis eda789c3c2 Improves add_timestamps_with_timezone helper
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.
2019-07-18 15:47:01 +00:00
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00
Jason Goodman 96b116d099 Support jsonb Default Value in add_column_with_default Migration Helper 2019-06-28 04:48:57 +00:00
pjaspers 6f5daf49d9 Use correct arg name
So funny story, true story. I tried to run the test locally, but
didn't make it past setting up Gitaly.

Here's what I tried:

First attempt:

`git clone gitlab-ce`
`cd gitlab-ce && bundle install`
`be rspec`

This didn't work because I was missing the config/database.yml, I
didn't see a `script/bootstrap` so I looked in the readme which
redirected me to a webpage which redirected me to the
gitlab-development-kit.

Second attempt:

`gem install gitlab-development-kit`
cd gitlab-development-kit
gdk init
gdk isntall

This broke somwhere along the way because it couldn't install Gitaly
because my go version was too low. But it did clone the gitlab repo
again and this time it did have a config/database.yml.

So I tried to cd into it and `be rspec
spec/lib/gitlab/database/migration_helpers_spec.rb` which complained
about the database not being configured so I:

- Changed the socket to localhost (in the config/database.yml)
- `createdb <dev_db>` `createdb test_db`
- `be rake db:test:prepare`

Great success, it was doing things! But then failed when it came at
the Gitaly step.

Since I only want to change these three lines, at the point I gave up
and entrusted the pipeline to do its thing.

What I would have liked:

- A 'It's a Rails system, I know this' readme/docs (It's in there
  somewhere just couldn't find it)
- A way to run tests without having to use Gitaly
- Not having too install all the things for a small fix (I get why'd
  you want this, but to me it's overkill)
2019-06-19 13:55:47 +02:00
pjaspers 31438ddd8b Fix syntax coloring on emacs
The rather cryptic:

      "fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}"

Was too much for emacs too handle*, since it was coming from the Rails
codebase I took their way of doing the same thing and applied it here.

I think it's easier to read and it also makes emacs render the
migration helpers pretty again.

* not true, emacs can handle anything, leave emacs alone!
2019-06-19 12:36:32 +02:00