diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-08-31 15:50:24 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-09-05 12:18:33 +0200 |
commit | 7f45dd92eaf70ec624d639f9d0354b6f3c512dc6 (patch) | |
tree | 57c0dc9255633abd5ae4a2f650ba90f9a1e18b58 /db/schema.rb | |
parent | ea4604e56da968f36427374a3e46b7625eded067 (diff) | |
download | gitlab-ce-7f45dd92eaf70ec624d639f9d0354b6f3c512dc6.tar.gz |
destroy all signatures and add with default value
To avoid having to implement legacy code handling for the obsolete
`verified_signature` attribute and to avoid any race conditions during
the zero-downtime-deployment we do the following:
1. Destroy all records
2. Migration: Use add_column_with_default to add the new attribute and
update the verification_status values on records created between 1.
and 2.
3. Deploy the new code
4. Post migration: Destroy all records
Like this we make sure that at no point there is a record with a `nil`
value for the new `verification_status` attribute.
Diffstat (limited to 'db/schema.rb')
-rw-r--r-- | db/schema.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/schema.rb b/db/schema.rb index e2c602b000f..8db0d080166 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -614,7 +614,7 @@ ActiveRecord::Schema.define(version: 20170830125940) do t.binary "gpg_key_primary_keyid" t.text "gpg_key_user_name" t.text "gpg_key_user_email" - t.integer "verification_status", limit: 2 + t.integer "verification_status", limit: 2, default: 0, null: false end add_index "gpg_signatures", ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true, using: :btree |