Skip to content

Commit 2e7f5f2

Browse files
committed
Take advantage of db default
1 parent 01e90ad commit 2e7f5f2

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

sa/db-next/boulder_sa/20250519000000_NullRegistrationsContact.sql

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../db/boulder_sa/20250519000000_NullRegistrationsContact.sql
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- +migrate Up
2+
-- SQL in section 'Up' is executed when this migration is applied
3+
4+
ALTER TABLE `registrations` ALTER COLUMN `contact` SET DEFAULT '[]';
5+
6+
-- +migrate Down
7+
-- SQL section 'Down' is executed when this migration is rolled back
8+
9+
ALTER TABLE `registrations` ALTER COLUMN `LockCol` DROP DEFAULT;

sa/model.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@ type regModel struct {
276276
CreatedAt time.Time `db:"createdAt"`
277277
LockCol int64
278278
Status string `db:"status"`
279-
// Deprecated: never populated from the database, and always written to the
280-
// database as just "[]".
281-
Contact string `db:"contact"`
282279
}
283280

284281
func registrationPbToModel(reg *corepb.Registration) (*regModel, error) {
@@ -304,7 +301,6 @@ func registrationPbToModel(reg *corepb.Registration) (*regModel, error) {
304301
ID: reg.Id,
305302
Key: reg.Key,
306303
KeySHA256: sha,
307-
Contact: "[]",
308304
Agreement: reg.Agreement,
309305
CreatedAt: createdAt,
310306
Status: reg.Status,

0 commit comments

Comments
 (0)