diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2015-11-02 18:14:34 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2015-11-02 18:14:34 +0300 |
commit | 35b93f9d223e132a66501920ba84d5ece1013aab (patch) | |
tree | 1ea98350b0c92cf8983f7fd633f894c76df9f8f6 /doc/development/migration_style_guide.md | |
parent | a9f02300c885df3b7f7cad6d79e161b9547e8723 (diff) |
Add notice about offline migrations
Diffstat (limited to 'doc/development/migration_style_guide.md')
-rw-r--r-- | doc/development/migration_style_guide.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index 4fa1961fde9..4e108c17871 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -8,6 +8,8 @@ In addition, having to take a server offline for a an upgrade small or big is a big burden for most organizations. For this reason it is important that your migrations are written carefully, can be applied online and adhere to the style guide below. +It's advised to have offline migrations only in major GitLab releases. + When writing your migrations, also consider that databases might have stale data or inconsistencies and guard for that. Try to make as little assumptions as possible about the state of the database. @@ -33,6 +35,8 @@ It is always preferable to have a migration run online. If you expect the migrat to take particularly long (for instance, if it loops through all notes), this is valuable information to add. +If you don't provide the information it means that a migration is safe to run online. + ### Reversibility Your migration should be reversible. This is very important, as it should @@ -85,4 +89,4 @@ select_all("SELECT name, COUNT(id) as cnt FROM tags GROUP BY name HAVING COUNT(i execute("UPDATE taggings SET tag_id = #{origin_tag_id} WHERE tag_id IN(#{duplicate_ids.join(",")})") execute("DELETE FROM tags WHERE id IN(#{duplicate_ids.join(",")})") end -``` +```
\ No newline at end of file |