Skip to content

Commit 630e4d5

Browse files
committed
Remove default value for mou_signature agreement_type
We set a default value for the agreement_type when we added the column so we pre-populated existing records with that value. Remove the default value to make sure we're always deliberately setting the correct agreement_type for new records.
1 parent 9348cdc commit 630e4d5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class RemoveDefaultValueForMouSignatureAgreementType < ActiveRecord::Migration[8.1]
2+
def up
3+
change_column_default :mou_signatures, :agreement_type, nil
4+
end
5+
6+
def down
7+
change_column_default :mou_signatures, :agreement_type, "crown"
8+
end
9+
end

db/schema.rb

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

db/seeds.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
research_contact_status: :consented,
2929
user_research_opted_in_at: Time.zone.now })
3030

31-
MouSignature.create! user: default_user, organisation: gds
31+
MouSignature.create! user: default_user, organisation: gds, agreement_type: "crown"
3232

3333
# create extra organisations
3434
test_org = Organisation.create! slug: "test-org", name: "Test Org", abbreviation: "TO"

0 commit comments

Comments
 (0)