Commit c866a62a authored by Toon Claes's avatar Toon Claes

Merge branch 'tc-geo-verification-columns-doc' into 'master'

Geo: Use text instead of string for verification state

See merge request gitlab-org/gitlab!36714
parents ba4c2b16 128bb57c
...@@ -360,11 +360,33 @@ Widgets should now be replicated by Geo! ...@@ -360,11 +360,33 @@ Widgets should now be replicated by Geo!
DOWNTIME = false DOWNTIME = false
def change def change
add_column :widgets, :verification_retry_at, :datetime_with_timezone change_table(:widgets) do |t|
add_column :widgets, :verified_at, :datetime_with_timezone t.integer :verification_retry_count, limit: 2
add_column :widgets, :verification_checksum, :binary, using: 'verification_checksum::bytea' t.column :verification_retry_at, :datetime_with_timezone
add_column :widgets, :verification_failure, :string t.column :verified_at, :datetime_with_timezone
add_column :widgets, :verification_retry_count, :integer t.binary :verification_checksum, using: 'verification_checksum::bytea'
# rubocop:disable Migration/AddLimitToTextColumns
t.text :verification_failure
# rubocop:enable Migration/AddLimitToTextColumns
end
end
end
```
Adding a `text` column also [requires](../database/strings_and_the_text_data_type.md#add-a-text-column-to-an-existing-table)
setting a limit:
```ruby
# frozen_string_literal: true
class AddVerificationFailureLimitToWidgets < ActiveRecord::Migration[6.0]
DOWNTIME = false
disable_ddl_transaction!
def change
add_text_limit :widgets, :verification_failure, 255
end end
end end
``` ```
......
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