Skip to content

Commit

Permalink
fix(journal): Remove empty check for operation's field
Browse files Browse the repository at this point in the history
Signed-off-by: Rodney Osodo <[email protected]>
  • Loading branch information
rodneyosodo committed Jun 26, 2024
1 parent 376455d commit e9f64a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion journal/postgres/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Migration() *migrate.MemoryMigrationSource {
Up: []string{
`CREATE TABLE IF NOT EXISTS journal (
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
operation VARCHAR NOT NULL CHECK (operation <> ''),
operation VARCHAR NOT NULL,
occurred_at TIMESTAMP NOT NULL,
attributes JSONB NOT NULL,
metadata JSONB,
Expand Down
4 changes: 2 additions & 2 deletions journal/postgres/journal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ func TestJournalSave(t *testing.T) {
desc: "with empty journal operation",
journal: journal.Journal{
Operation: "",
OccurredAt: time.Now(),
OccurredAt: time.Now().Add(-time.Hour),
Attributes: payload,
Metadata: payload,
},
err: repoerr.ErrCreateEntity,
err: nil,
},
{
desc: "with nil journal occurred_at",
Expand Down

0 comments on commit e9f64a5

Please sign in to comment.