Commit Graph

194 Commits

Author SHA1 Message Date
GitLab Bot 77a73903aa Add latest changes from gitlab-org/gitlab@master 2019-11-01 18:06:00 +00:00
GitLab Bot eadb77d89f Add latest changes from gitlab-org/gitlab@master 2019-10-07 18:06:24 +00:00
GitLab Bot 4a45a78770 Add latest changes from gitlab-org/gitlab@master 2019-09-24 06:06:02 +00:00
GitLab Bot c792263edf Add latest changes from gitlab-org/gitlab@master 2019-09-23 18:06:14 +00:00
GitLab Bot b082790134 Add latest changes from gitlab-org/gitlab@master 2019-09-18 18:06:14 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Evan Read 42e8bef3eb Removes trailing whitespace to fix linting 2019-08-27 11:31:43 +00:00
Mayra Cabrera 9d5ea4203c Migrations guide: use atomic steps, when possible
Currently, the DB migrations guide says that "you must" use non-blocking
operations (such as CREATE INDEX CONCURRENTLY), always.

But this does not make sense in cases of empty tables and leads to
splitting the work to multiple non-atomic
(with disable_ddl_transaction!) DB migrations.

To follow KISS principle, to have fewer DB migrations steps,
to have them atomic when it's possible and simplify deployment
and troubleshooting, the following exceptions were added
to the doc:

- index creation,
- index dropping,
- defining an FK,
- adding a column with DEFAULT,
2019-08-27 10:22:12 +00:00
Valery Sizov 19f36a3452 Update Migration Style Guide 2019-08-07 18:02:20 +03:00
Marcel Amirault 347a879909 Update redirected links to final destination
Updating redirected links in the development, install, policy
raketasks and university dirs. Should now link to final
URL to avoid redirect hops
2019-07-09 00:20:40 +00:00
Shinya Maeda ff14b58dc5 Add note for index requirement with FK constraint
Update migration_style_guide.md
2019-05-23 12:45:52 +00:00
Gosia Ksionek fb94014773 Add information about moving migrations
Add to docs paragraph about a way of moving EE migrations to CE
if needed
2019-04-12 16:41:59 +00:00
Evan Read 47fb1c5235 Remove consecutive blank lines from markdown files
For the sake of consistency, removes any extraneous
consecutive blank lines from the doc suite.
2019-02-18 09:36:13 +00:00
Evan Read d98560c1f5 Make unordered lists conform to styleguide
- Also makes other minor Markdown fixes that were near the main fixes.
2019-01-08 12:21:09 +10:00
Kamil Trzciński 0103d5be96 Add config_options|variables to BuildMetadata
These are data columns that store runtime configuration
of build needed to execute it on runner and within pipeline.

The definition of this data is that once used, and when no longer
needed (due to retry capability) they can be freely removed.

They use `jsonb` on PostgreSQL, and `text` on MySQL (due to lacking
support for json datatype on old enough version).
2019-01-04 16:38:17 +01:00
Yorick Peterse 40ad7d5d7a
Fix ActiveRecord::Migration deprecations
Extending from ActiveRecord::Migration is deprecated, but was still used
in a bunch of places.
2018-12-12 16:38:40 +01:00
Yorick Peterse 3cf5ae3158 Merge branch 'improve_migrations_docs' into 'master'
Documentation: Correct inaccurate phrase related to disable_ddl_transaction mode

See merge request gitlab-org/gitlab-ce!21175
2018-11-20 12:18:42 +00:00
Kamil Trzciński 90801a43ca Validate foreign keys being indexed 2018-11-15 12:51:15 +01:00
Nikolay 918177b749 Correct inaccurate phrase related to disable_ddl_transaction mode 2018-08-14 00:51:27 +00:00
Andreas Brandl 3d2a3e5782 Docs: FK constraints require an index.
Closes #49789.
2018-08-08 23:30:48 +02:00
Brett Walker 7b0e7bcf5d make a little more obvious what operations might need downtime or enhanced migration techniques 2018-03-22 16:08:21 +00:00
Andreas Brandl 1362d9fe13 Shortcut concurrent index creation/removal if no effect.
Index creation does not have an effect if the index is present already.
Index removal does not have an affect if the index is not present.

This helps to avoid patterns like this in migrations:
```
if index_exists?(...)
  remove_concurrent_index(...)
end
```
2018-03-20 18:44:00 +01:00
Ville Skyttä 0cbbb08e79 doc: Spelling fixes 2018-01-19 12:09:59 +02:00
Sean McGivern 4d367dd400 Add computed update docs for update_column_in_batches 2017-11-17 16:56:50 +00:00
Yorick Peterse d5cb29434a
Mention schema migrations and patch releases 2017-08-04 13:34:42 +02:00
Yorick Peterse 9d3f27a22d
Removed commit guidelines for migrations
At some point we decided this isn't really necessary, so let's get rid
of it.
2017-08-04 13:34:42 +02:00
blackst0ne bc00806a4e Add database helpers 'add_timestamps_with_timezone' and 'timestamps_with_timezone' 2017-06-13 22:44:13 +11:00
Bob Van Landuyt ffc486a585 Add some documentation for the new migration helpers 2017-05-02 14:10:55 +02:00
Yorick Peterse 223d8a3d26
Prepare for zero downtime migrations
Starting with GitLab 9.1.0 we will no longer allow downtime migrations
unless absolutely necessary. This commit updates the various developer
guides and adds code that is necessary to make zero downtime migrations
less painful.
2017-04-12 18:15:19 +02:00
blackst0ne 9997c58fc0 Add remove_concurrent_index to database helper 2017-04-06 09:53:57 +11:00
Robert Speicher 9a2ad60ffa Add more highlighting to Migration Style Guide doc
[ci skip]
2016-11-09 10:59:15 +00:00
Nick Thomas 267a96f3d4 Link to the "What requires downtime?" page from the Migration Style Guide
[ci skip]
2016-10-02 20:36:45 +01:00
Drew Blessing e000f02bd3 Add support for column limits in add_column_with_default 2016-09-15 21:59:58 -05:00
Yorick Peterse a8bfe20d0d
Added checks for migration downtime
These new checks can be used to check if migrations require downtime or
not (as tagged by their authors). In CI this compares the current branch
with master so migrations added by merge requests are automatically
verified.

To check the migrations added since a Git reference simply run:

    bundle exec rake gitlab:db:downtime_check[GIT_REF]
2016-07-20 12:41:56 +02:00
Drew Blessing 8d96bae6db Remove Rubocop skip comment from migration style guide [ci skip] 2016-06-23 09:01:04 -05:00
Drew Blessing 8033afd817 Update migration_style_guide.md with new details 2016-06-15 21:38:12 +00:00
Chris Spicer 348d16f524 updtae -> update 2016-05-29 22:31:39 -07:00
Yorick Peterse e8efaca23c
Updated migration styleguide for new helpers 2016-05-12 13:03:55 +02:00
Rémy Coutable a4ffdf922d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-02-17 17:33:09 +01:00
Prayag Verma b877afc371 Fix a typo [ci skip]
Remove extra `make`
2016-02-12 19:02:35 +05:30
Kamil Trzciński 35b93f9d22 Add notice about offline migrations 2015-11-02 15:14:34 +00:00
Valery Sizov 34a9aa2e8a update migration style guide 2015-05-12 14:34:43 +03:00
Sytse Sijbrandij 881e11df1b Small improvements to style guide. 2015-05-11 14:48:39 +00:00
Job van der Voort 6a6047f80c create migration style guide. Fixes #2305 2015-05-11 15:09:36 +02:00