Skip to content

Commit

Permalink
Fix DecisionToken to comply with MySQL8
Browse files Browse the repository at this point in the history
  • Loading branch information
camlyall authored Jul 28, 2023
1 parent d87b17d commit 87ac9e0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/collection/goa.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (w *goaWrapper) Decide(ctx context.Context, payload *goacollection.DecidePa
return err
}

if c.DecisionToken == "" || c.Status != StatusPending {
if len(c.DecisionToken) == 0 || c.Status != StatusPending {
return goacollection.MakeNotValid(errors.New("collection is not awaiting decision"))
}

Expand Down
2 changes: 1 addition & 1 deletion internal/collection/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Collection struct {
AIPID string `db:"aip_id"`
OriginalID string `db:"original_id"`
PipelineID string `db:"pipeline_id"`
DecisionToken string `db:"decision_token"`
DecisionToken []byte `db:"decision_token"`
Status Status `db:"status"`

// It defaults to CURRENT_TIMESTAMP(6) so populated as soon as possible.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE collection CHANGE `decision_token` `decision_token` TEXT NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE collection CHANGE `decision_token` `decision_token` VARBINARY(255);

0 comments on commit 87ac9e0

Please sign in to comment.