Supply enrichment_attempts in tracker pattern seed
The migration dropped the DEFAULT on common_tracker_patterns.enrichment_attempts, so the column is now NOT NULL with no default and inserts must set it explicitly. The e2e seedCommonTrackerPattern helper still did a raw insert without it, which broke TestThirdParty_ImportFromCommon and TestTrackerPattern_CommonTrackerPatternID with a 23502 violation. Pass 0 for the seeded rows. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -667,11 +667,11 @@ func seedCommonTrackerPattern(t *testing.T) gid.GID {
|
|||||||
|
|
||||||
_, err := conn.Exec(ctx, `
|
_, err := conn.Exec(ctx, `
|
||||||
INSERT INTO common_tracker_patterns (
|
INSERT INTO common_tracker_patterns (
|
||||||
id, tracker_type, pattern, match_type, description, confidence, created_at, updated_at
|
id, tracker_type, pattern, match_type, description, confidence, enrichment_attempts, created_at, updated_at
|
||||||
) VALUES (
|
) VALUES (
|
||||||
$1, $2, $3, $4, $5, $6, $7, $8
|
$1, $2, $3, $4, $5, $6, $7, $8, $9
|
||||||
)
|
)
|
||||||
`, id, "COOKIE", "e2e_common_"+id.String(), "EXACT", "Seeded catalog description", 1.0, now, now)
|
`, id, "COOKIE", "e2e_common_"+id.String(), "EXACT", "Seeded catalog description", 1.0, 0, now, now)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ func buildCommonPatternEnrichmentMetadata(
|
|||||||
}
|
}
|
||||||
|
|
||||||
thirdPartyStatus := commonPatternFieldStatusNotFound
|
thirdPartyStatus := commonPatternFieldStatusNotFound
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case alreadyLinked:
|
case alreadyLinked:
|
||||||
thirdPartyStatus = commonPatternFieldStatusExternal
|
thirdPartyStatus = commonPatternFieldStatusExternal
|
||||||
|
|||||||
Reference in New Issue
Block a user