Commit Graph

4 Commits

Author SHA1 Message Date
Jan Provaznik 0fc9f9d3e7 Add version 4.2 to all existing migrations
DB schema generated by a migration may look different in
rails 4 and 5 (because rails 5 may use different default values).
For this reason it's important to explicitly set for which rails
version a migration was written for.

See https://stackoverflow.com/questions/35929869/activerecordmigration-deprecation-warning-asks-for-rails-version-but-im-no/35930912#35930912
2018-11-22 13:18:28 +01:00
Alexis Reigel 703b39d440 truncate gpg signature instead of destroy 2017-09-05 12:18:34 +02:00
Alexis Reigel 7f45dd92ea 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.
2017-09-05 12:18:33 +02:00
Alexis Reigel ff413ec28d add verification_status to gpg signatures 2017-09-05 12:18:31 +02:00