Commit 28e1ce3a authored by Francisco Javier López's avatar Francisco Javier López Committed by Andreas Brandl

Add migrations for version control snippets

Add columns `repository_storage` and `storage_version`
to snippets.
parent 4f2af0e9
---
title: Add migrations for version control snippets
merge_request: 22275
author:
type: added
# frozen_string_literal: true
class AddRepositoryStorageToSnippets < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
:snippets,
:repository_storage,
:string,
default: 'default',
limit: 255,
allow_null: false
)
end
def down
remove_column(:snippets, :repository_storage)
end
end
# frozen_string_literal: true
class AddStorageVersionToSnippets < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
:snippets,
:storage_version,
:integer,
default: 2,
allow_null: false
)
end
def down
remove_column(:snippets, :storage_version)
end
end
......@@ -3803,6 +3803,8 @@ ActiveRecord::Schema.define(version: 2020_01_06_071113) do
t.string "encrypted_secret_token", limit: 255
t.string "encrypted_secret_token_iv", limit: 255
t.boolean "secret", default: false, null: false
t.string "repository_storage", limit: 255, default: "default", null: false
t.integer "storage_version", default: 2, null: false
t.index ["author_id"], name: "index_snippets_on_author_id"
t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["created_at"], name: "index_snippets_on_created_at"
......
......@@ -172,6 +172,8 @@ excluded_attributes:
- :secret
- :encrypted_secret_token
- :encrypted_secret_token_iv
- :repository_storage
- :storage_version
merge_request_diff:
- :external_diff
- :stored_externally
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment