Commit Graph

63 Commits

Author SHA1 Message Date
GitLab Bot 3eb814543a Add latest changes from gitlab-org/gitlab@master 2021-06-22 00:07:53 +00:00
GitLab Bot f69bc1dab5 Add latest changes from gitlab-org/gitlab@master 2021-06-14 18:10:28 +00:00
GitLab Bot 926711e454 Add latest changes from gitlab-org/gitlab@master 2021-06-02 00:09:56 +00:00
GitLab Bot 03c84e0de5 Add latest changes from gitlab-org/gitlab@master 2021-05-27 06:10:47 +00:00
GitLab Bot b7eed2ea49 Add latest changes from gitlab-org/gitlab@master 2021-05-11 06:10:29 +00:00
GitLab Bot c06178d51a Add latest changes from gitlab-org/gitlab@master 2021-05-06 09:18:56 +00:00
GitLab Bot be4b3134a2 Add latest changes from gitlab-org/gitlab@master 2021-05-04 15:10:36 +00:00
GitLab Bot d7fd035dc3 Add latest changes from gitlab-org/gitlab@master 2021-04-12 12:09:15 +00:00
GitLab Bot d2091d1e92 Add latest changes from gitlab-org/gitlab@master 2021-03-10 15:09:11 +00:00
GitLab Bot 6559f0ee67 Add latest changes from gitlab-org/gitlab@master 2020-10-19 12:09:20 +00:00
GitLab Bot ec18750aa8 Add latest changes from gitlab-org/gitlab@master 2020-10-05 18:08:51 +00:00
GitLab Bot 91ef4dcc05 Add latest changes from gitlab-org/gitlab@master 2020-10-02 06:08:27 +00:00
GitLab Bot c7a46b0419 Add latest changes from gitlab-org/gitlab@master 2020-08-21 00:10:44 +00:00
GitLab Bot 448ff1fb83 Add latest changes from gitlab-org/gitlab@master 2020-07-22 03:09:40 +00:00
GitLab Bot f9cda7671c Add latest changes from gitlab-org/gitlab@master 2020-07-14 21:09:03 +00:00
GitLab Bot fcda041fc0 Add latest changes from gitlab-org/gitlab@master 2020-07-09 12:08:56 +00:00
GitLab Bot c52b72f577 Add latest changes from gitlab-org/gitlab@master 2020-07-08 12:09:33 +00:00
GitLab Bot 4d8bd36aa2 Add latest changes from gitlab-org/gitlab@master 2020-07-07 03:09:32 +00:00
GitLab Bot 5d6119a1a4 Add latest changes from gitlab-org/gitlab@master 2020-06-25 00:09:26 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot 72721699f1 Add latest changes from gitlab-org/gitlab@master 2020-02-18 00:09:20 +00:00
GitLab Bot 96b0c1245c Add latest changes from gitlab-org/gitlab@master 2020-01-10 12:07:47 +00:00
GitLab Bot e723867717 Add latest changes from gitlab-org/gitlab@master 2019-12-17 18:07:48 +00:00
GitLab Bot cfc792b9ca Add latest changes from gitlab-org/gitlab@master 2019-12-10 07:53:40 +00:00
GitLab Bot b4e072cbaf Add latest changes from gitlab-org/gitlab@master 2019-10-11 06:06:27 +00:00
Tiger 08fcb2379e CE port: allow SRV records in DB service discovery 2019-08-23 14:19:51 +10: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
Thong Kuah f540ffcef6 Add frozen_string_literal to spec/lib (part 1)
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-26 13:25:07 +12: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
Douglas Barbosa Alexandre a86f48c79b
Add helper method to return a human-friendly name for database adapter 2019-03-21 19:03:26 -03:00
Ash McKenzie 26134eeece Rename pg_stat_wal_receiver_supported? DB helper
From pg_stat_wal_receiver_supported? to
postgresql_minimum_supported_version?

Also add test coverage
2019-03-14 15:25:05 +00:00
Jasper Maes 56296f1eda Remove rails4 specific code 2018-12-16 10:48:41 +01:00
Jasper Maes 44fef4fe4c Remove rails 4 support in CI, Gemfiles, bin/ and config/ 2018-12-14 19:36:22 +01:00
Douglas Barbosa Alexandre 5f8423dd85
CE port of 'Move EE specific code from Gitbab::Database into ee' 2018-11-26 17:14:05 -02:00
Yorick Peterse 2ade035eb2
Backport various EE changes to Gitlab::Database
These changes are useful for CE as well. For example, the MR
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20720 can make
use of some of the backported methods.
2018-07-24 13:25:01 +02:00
Brett Walker fd2ea94f60 Ability to check if underlying database is read only 2018-07-06 17:07:49 +00:00
Jarka Kadlecová fa36101a7f Use data_source_exists? instead of table_exists?
Use data_source_exists? where possible instead of table_exists? in order to be Rails5 compatible
2018-06-14 08:39:43 +02:00
Yorick Peterse 63c58a6dd0
Memoize Gitlab::Database.version
This removes the need for running a database query every time we want to
check the database version.
2018-05-17 21:23:42 +02:00
Stan Hu 272783be20 Cache table_exists?('application_settings') to reduce repeated schema reloads
Closes #43355
2018-03-15 13:13:00 -07:00
Stan Hu 4acbc9410d Cache column_exists? for application settings
This is most a backport of
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4987/diffs but includes
other columns that use column_exists? in a way that may cause unnecessary
schema loads.
2018-03-15 12:51:39 -07:00
Stan Hu 29e39e55c3 Merge branch 'mk-add-old-attachments-to-uploads-table' into 'master'
Add old files to uploads table

See merge request gitlab-org/gitlab-ce!15270
2017-12-07 02:34:58 +00:00
Brett Walker 02d97d4621 add Gitlab::Database.replication_slots_supported? 2017-12-05 16:43:47 +00:00
Michael Kozono 71d2704418 Add tests for disable_quote option 2017-12-01 15:26:42 -08:00
Yorick Peterse bda30182e0
Add returning IDs to Gitlab::Database.bulk_insert
This adds the keyword argument "return_ids" to
Gitlab::Database.bulk_insert. When set to `true` (and PostgreSQL is
used) this method will return an Array of the IDs of the inserted rows,
otherwise it will return an empty Array.
2017-11-07 22:28:57 +01:00
Alejandro Rodríguez 1796936abc Handle large values on `MergeRequestDiffCommit` dates 2017-10-30 21:13:39 -03:00
Yorick Peterse aac1de46c9
Use a specialized class for querying events
This changes various controllers to use the new EventCollection class
for retrieving events. This class uses a JOIN LATERAL query on
PostgreSQL to retrieve queries in a more efficient way, while falling
back to a simpler / less efficient query for MySQL.

The EventCollection class also includes a limit on the number of events
to display to prevent malicious users from cycling through all events,
as doing so could put a lot of pressure on the database.

JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
and as such this optimisation is only used when using PostgreSQL 9.3 or
newer.
2017-08-10 17:45:49 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Sean McGivern d4a3474b9b Fix Gitlab::Database.bulk_insert for non-UTF-8 data 2017-06-26 17:21:40 +01:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Sean McGivern 9a73b634ab Add table for files in merge request diffs
This adds an ID-less table containing one row per file, per merge request
diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised
currently, with the advantage that we can easily query the attributes of this
new table.

It does not migrate existing data, so we have fallback code when the legacy
st_diffs column is present instead. For a merge request diff to be valid, it
should have at most one of:

* Rows in this new table, with the correct merge_request_diff_id.
* A non-NULL st_diffs column.

It may have neither, if the diff is empty.
2017-06-16 18:30:01 +01:00