diff --git a/internal/db/schema/migrations/oss/postgres/26/01_wh_network_address_dimensions.up.sql b/internal/db/schema/migrations/oss/postgres/26/01_wh_network_address_dimensions.up.sql index 46bf01f8e..87ce20c0e 100644 --- a/internal/db/schema/migrations/oss/postgres/26/01_wh_network_address_dimensions.up.sql +++ b/internal/db/schema/migrations/oss/postgres/26/01_wh_network_address_dimensions.up.sql @@ -108,7 +108,7 @@ begin; ip4_address, ip6_address ) - select + select distinct address, 'IP Address', case @@ -135,7 +135,7 @@ begin; dns_name, ip4_address, ip6_address ) - select + select distinct whd.host_address, 'DNS Name', 'Not Applicable', 'Not Applicable', whd.host_address, diff --git a/internal/db/schema/migrations/oss/postgres_26_01_test.go b/internal/db/schema/migrations/oss/postgres_26_01_test.go index 1866e8c58..c6f1b9f8f 100644 --- a/internal/db/schema/migrations/oss/postgres_26_01_test.go +++ b/internal/db/schema/migrations/oss/postgres_26_01_test.go @@ -185,6 +185,11 @@ values _, err := rw.Exec(ctx, q, []interface{}{a.Address}) require.NoError(t, err) } + // Duplicate a few records... + _, err := rw.Exec(ctx, q, []interface{}{addresses[1].Address}) + require.NoError(t, err) + _, err = rw.Exec(ctx, q, []interface{}{addresses[5].Address}) + require.NoError(t, err) } // now we're ready for the migration we want to test.