diff --git a/journal/postgres/init.go b/journal/postgres/init.go index 19b73b48e1..52da4421e2 100644 --- a/journal/postgres/init.go +++ b/journal/postgres/init.go @@ -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, diff --git a/journal/postgres/journal_test.go b/journal/postgres/journal_test.go index 151f53019f..abeb79a2db 100644 --- a/journal/postgres/journal_test.go +++ b/journal/postgres/journal_test.go @@ -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",